sahilTakiar commented on a change in pull request #597: HDFS-3246: pRead
equivalent for direct read path
URL: https://github.com/apache/hadoop/pull/597#discussion_r267932717
##########
File path:
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/crypto/CryptoStreamsTestBase.java
##########
@@ -129,6 +130,32 @@ private void preadCheck(PositionedReadable in) throws
Exception {
Assert.assertArrayEquals(result, expectedData);
}
+ private int byteBufferPreadAll(ByteBufferPositionedReadable in,
+ ByteBuffer buf) throws IOException {
+ int n = 0;
+ int total = 0;
+ while (n != -1) {
Review comment:
IIUC the HDFS read APIs make the same guarantees as
`InputStream#read(byte[]`, which returns -1 if there is no more data to read.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]