cxorm commented on a change in pull request #345: HDDS-2703. OzoneFSInputStream 
to support ByteBufferReadable
URL: https://github.com/apache/hadoop-ozone/pull/345#discussion_r357393478
 
 

 ##########
 File path: 
hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java
 ##########
 @@ -76,4 +79,21 @@ public boolean seekToNewSource(long targetPos) throws 
IOException {
   public int available() throws IOException {
     return inputStream.available();
   }
+
+  /**
+   * @param buf the ByteBuffer to receive the results of the read operation.
+   * @return the number of bytes read, possibly zero.
+   * @throws IOException if there is some error performing the read
+   */
+  @Override
+  public int read(ByteBuffer buf) throws IOException {
+
+    int bufInitPos = buf.position();
+    while (buf.hasRemaining() && (inputStream.available() > 0)) {
 
 Review comment:
   Thanks @bharatviswa504 for the review.
   Fixed, and work well.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to