rdblue commented on code in PR #953:
URL: https://github.com/apache/parquet-mr/pull/953#discussion_r857175617


##########
parquet-common/src/main/java/org/apache/parquet/bytes/SingleBufferInputStream.java:
##########
@@ -46,12 +74,19 @@ public long position() {
     return buffer.position() - startPosition;
   }
 
+  /*
+  Note: For all read methods, if we read off the end of the ByteBuffer, 
BufferUnderflowException is thrown, which
+  we catch and turn into an EOFException. This is measured to be faster than 
explicitly checking if the ByteBuffer
+  has any remaining bytes.
+   */
+
   @Override
   public int read() throws IOException {
-    if (!buffer.hasRemaining()) {
-       throw new EOFException();
+    try {
+      return buffer.get() & 255;

Review Comment:
   Can you revert the change to the constant?



-- 
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: dev-unsubscr...@parquet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to