Skip to content

Commit 31bc20b

Browse files
committed
PARQUET-787: Update tests for both ByteBufferInputStreams.
1 parent d943a20 commit 31bc20b

File tree

5 files changed

+797
-449
lines changed

5 files changed

+797
-449
lines changed

parquet-common/src/main/java/org/apache/parquet/bytes/MultiBufferInputStream.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ public ByteBuffer slice(int length) throws EOFException {
155155
slice = current.duplicate();
156156
slice.limit(slice.position() + length);
157157
current.position(slice.position() + length);
158+
this.position += length;
158159
}
159160

160161
return slice;

parquet-common/src/main/java/org/apache/parquet/bytes/SingleBufferInputStream.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ public ByteBuffer slice(int length) throws EOFException {
126126

127127
@Override
128128
public List<ByteBuffer> sliceBuffers(long length) throws EOFException {
129+
if (length == 0) {
130+
return Collections.emptyList();
131+
}
132+
129133
if (length > buffer.remaining()) {
130134
throw new EOFException();
131135
}

0 commit comments

Comments
 (0)