|
28 | 28 |
|
29 | 29 | import java.io.ByteArrayOutputStream; |
30 | 30 | import java.io.IOException; |
31 | | -import java.nio.Buffer; |
32 | | -import java.nio.ByteBuffer; |
33 | 31 | import java.nio.InvalidMarkException; |
34 | 32 | import org.junit.After; |
35 | 33 | import org.junit.Before; |
@@ -121,27 +119,6 @@ public void readByteArrayShouldSucceed() { |
121 | 119 | assertEquals(EXPECTED_VALUE, new String(bytes, UTF_8)); |
122 | 120 | } |
123 | 121 |
|
124 | | - @Test |
125 | | - public void readByteBufferShouldSucceed() { |
126 | | - ByteBuffer byteBuffer = ByteBuffer.allocate(EXPECTED_VALUE.length()); |
127 | | - int remaining = EXPECTED_VALUE.length(); |
128 | | - |
129 | | - ((Buffer) byteBuffer).limit(1); |
130 | | - composite.readBytes(byteBuffer); |
131 | | - remaining--; |
132 | | - assertEquals(remaining, composite.readableBytes()); |
133 | | - |
134 | | - ((Buffer) byteBuffer).limit(byteBuffer.limit() + 5); |
135 | | - composite.readBytes(byteBuffer); |
136 | | - remaining -= 5; |
137 | | - assertEquals(remaining, composite.readableBytes()); |
138 | | - |
139 | | - ((Buffer) byteBuffer).limit(byteBuffer.limit() + remaining); |
140 | | - composite.readBytes(byteBuffer); |
141 | | - assertEquals(0, composite.readableBytes()); |
142 | | - assertEquals(EXPECTED_VALUE, new String(byteBuffer.array(), UTF_8)); |
143 | | - } |
144 | | - |
145 | 122 | @Test |
146 | 123 | public void readStreamShouldSucceed() throws IOException { |
147 | 124 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
@@ -216,18 +193,6 @@ public void markAndResetWithReadByteArrayShouldSucceed() { |
216 | 193 | assertArrayEquals(first, second); |
217 | 194 | } |
218 | 195 |
|
219 | | - @Test |
220 | | - public void markAndResetWithReadByteBufferShouldSucceed() { |
221 | | - byte[] first = new byte[EXPECTED_VALUE.length()]; |
222 | | - composite.mark(); |
223 | | - composite.readBytes(ByteBuffer.wrap(first)); |
224 | | - composite.reset(); |
225 | | - byte[] second = new byte[EXPECTED_VALUE.length()]; |
226 | | - assertEquals(EXPECTED_VALUE.length(), composite.readableBytes()); |
227 | | - composite.readBytes(ByteBuffer.wrap(second)); |
228 | | - assertArrayEquals(first, second); |
229 | | - } |
230 | | - |
231 | 196 | @Test |
232 | 197 | public void markAndResetWithReadStreamShouldSucceed() throws IOException { |
233 | 198 | ByteArrayOutputStream first = new ByteArrayOutputStream(); |
|
0 commit comments