chungen0126 commented on code in PR #10765:
URL: https://github.com/apache/ozone/pull/10765#discussion_r3600133619


##########
hadoop-hdds/client/src/test/java/org/apache/hadoop/hdds/scm/storage/TestChunkInputStream.java:
##########
@@ -284,4 +284,26 @@ public void connectsToNewPipeline() throws Exception {
       verify(newToken).encodeToUrlString();
     }
   }
+
+  @Test
+  public void testPositionedRead() throws Exception {
+    byte[] buffer = new byte[50];
+    ByteBuffer byteBuffer = ByteBuffer.wrap(buffer);
+    int bytesRead = chunkStream.read(30, byteBuffer);
+
+    assertEquals(50, bytesRead);

Review Comment:
   The buffer is filled until the stream reaches its end. For example, if the 
buffer capacity is 50 but only 10 bytes are left in the stream, only the first 
10 bytes of the buffer will be filled.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to