You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/06/21 22:14:52 UTC

[GitHub] [hadoop] jojochuang commented on a change in pull request #963: HDFS-14564: Add libhdfs APIs for readFully; add readFully to ByteBufferPositionedReadable

jojochuang commented on a change in pull request #963: HDFS-14564: Add libhdfs APIs for readFully; add readFully to ByteBufferPositionedReadable
URL: https://github.com/apache/hadoop/pull/963#discussion_r296409550
 
 

 ##########
 File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/CryptoInputStream.java
 ##########
 @@ -363,7 +363,23 @@ public int read(long position, final ByteBuffer buf)
 
     return n;
   }
-  
+
+  @Override
+  public void readFully(long position, ByteBuffer buf) throws IOException {
+    checkStream();
+    if (!(in instanceof ByteBufferPositionedReadable)) {
+      throw new UnsupportedOperationException("This stream does not support " +
+          "positioned reads with byte buffers.");
 
 Review comment:
   The exception message could be confusing; it's not the CryptoInputStream that doesn't support byte buffer positioned reads, it's the input stream wrapped by it. How about printing the class name of the object in?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org