theosib-amazon commented on code in PR #960:
URL: https://github.com/apache/parquet-mr/pull/960#discussion_r860183308
##########
parquet-common/src/main/java/org/apache/parquet/bytes/ByteBufferInputStream.java:
##########
@@ -49,6 +59,19 @@ public static ByteBufferInputStream wrap(List<ByteBuffer>
buffers) {
}
}
+ public static ByteBufferInputStream wrap(ByteBuffer buffer, int offset, int
count) {
Review Comment:
This was to make ByteBufferInputStream resemble ByteBuffer. ByteBuffer has
methods like this. I've gone ahead and removed them at your request.
##########
parquet-common/src/main/java/org/apache/parquet/bytes/ByteBufferInputStream.java:
##########
@@ -74,11 +97,26 @@ public ByteBufferInputStream(ByteBuffer buffer) {
*/
@Deprecated
public ByteBufferInputStream(ByteBuffer buffer, int offset, int count) {
+ // This is necessary to pass "TestDeprecatedBufferInputStream"...
ByteBuffer temp = buffer.duplicate();
temp.position(offset);
ByteBuffer byteBuf = temp.slice();
byteBuf.limit(count);
delegate = wrap(byteBuf);
+ // ... but it would probably be faster to do this:
+// delegate = wrap(buffer, offset, count);
Review Comment:
Done.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]