theosib-amazon commented on code in PR #960: URL: https://github.com/apache/parquet-mr/pull/960#discussion_r934649460
########## parquet-common/src/main/java/org/apache/parquet/bytes/SingleBufferInputStream.java: ########## @@ -174,4 +254,64 @@ public boolean markSupported() { public int available() { return buffer.remaining(); } + + @Override + public byte readByte() throws IOException { + try { + return buffer.get(); + } catch (BufferUnderflowException e) { + throw new EOFException(e.getMessage()); + } + } + + @Override + public int readUnsignedByte() throws IOException { + try { + return buffer.get() & 0xFF; + } catch (BufferUnderflowException e) { + throw new EOFException(e.getMessage()); + } + } + + @Override + public short readShort() throws IOException { + try { + return buffer.getShort(); + } catch (BufferUnderflowException e) { + throw new EOFException(e.getMessage()); + } + } + + @Override + public int readUnsignedShort() throws IOException { + try { + return buffer.getShort() & 0xFFFF; + } catch (BufferUnderflowException e) { + throw new EOFException(e.getMessage()); + } + } + + /* + Use ByteBuffer.getInt(), which takes advantage of platform intrinsics + */ + @Override + public int readInt() throws IOException { + try { + return buffer.getInt(); + } catch (BufferUnderflowException e) { + throw new EOFException(e.getMessage()); + } + } + + /* + Use ByteBuffer.getLonmg(), which takes advantage of platform intrinsics Review Comment: got it -- 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