@@ -109,8 +109,6 @@ public void readFullyIntoHeapByteBuffer() throws IOException {
109109
110110 @ Test
111111 public void readFullyIntoHeapByteBufferWithNonZeroPosition () throws IOException {
112- // Regression: the buggy implementation passed buf.position() as the src offset to
113- // ByteBuffer.put(byte[], int, int), which reads from the wrong location in the source array.
114112 Path path = writeBytes (new byte [] {10 , 20 , 30 , 40 });
115113 try (SeekableInputStream stream = new LocalInputFile (path ).newStream ()) {
116114 ByteBuffer buf = ByteBuffer .allocate (6 );
@@ -126,8 +124,6 @@ public void readFullyIntoHeapByteBufferWithNonZeroPosition() throws IOException
126124
127125 @ Test
128126 public void readFullyIntoDirectByteBuffer () throws IOException {
129- // Regression: the buggy implementation called arrayOffset() which throws
130- // UnsupportedOperationException on direct buffers.
131127 Path path = writeBytes (new byte [] {7 , 8 , 9 });
132128 try (SeekableInputStream stream = new LocalInputFile (path ).newStream ()) {
133129 ByteBuffer buf = ByteBuffer .allocateDirect (3 );
@@ -142,7 +138,6 @@ public void readFullyIntoDirectByteBuffer() throws IOException {
142138
143139 @ Test
144140 public void readFullyIntoReadOnlyByteBuffer () throws IOException {
145- // Read-only views also throw from arrayOffset().
146141 Path path = writeBytes (new byte [] {7 , 8 , 9 });
147142 try (SeekableInputStream stream = new LocalInputFile (path ).newStream ()) {
148143 ByteBuffer backing = ByteBuffer .allocate (3 );
@@ -168,8 +163,6 @@ public void readIntoHeapByteBuffer() throws IOException {
168163
169164 @ Test
170165 public void readIntoByteBufferAdvancesPositionByBytesRead () throws IOException {
171- // Regression: the buggy implementation always advanced by buf.remaining() regardless of how
172- // many bytes were actually read, leaving the destination buffer inconsistent on partial reads.
173166 Path path = writeBytes (new byte [] {1 , 2 , 3 });
174167 try (SeekableInputStream stream = new LocalInputFile (path ).newStream ()) {
175168 ByteBuffer buf = ByteBuffer .allocate (10 );
@@ -208,8 +201,6 @@ public void readIntoDirectByteBuffer() throws IOException {
208201
209202 @ Test
210203 public void readIntoByteBufferWithNonZeroPosition () throws IOException {
211- // Regression: the buggy implementation passed buf.position() as the src offset to
212- // ByteBuffer.put(byte[], int, int), which reads from the wrong location in the source array.
213204 Path path = writeBytes (new byte [] {10 , 20 , 30 });
214205 try (SeekableInputStream stream = new LocalInputFile (path ).newStream ()) {
215206 ByteBuffer buf = ByteBuffer .allocate (5 );
0 commit comments