Skip to content

Commit 007b61a

Browse files
committed
fix: Add buffer position for transfer
1 parent 84e953b commit 007b61a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/software/coley/llzip/util/BufferData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void transferTo(OutputStream out, byte[] buf) throws IOException {
4646
ByteBuffer buffer = this.buffer;
4747
int remaining = buffer.remaining();
4848
if (buffer.hasArray()) {
49-
out.write(buffer.array(), buffer.arrayOffset(), remaining);
49+
out.write(buffer.array(), buffer.arrayOffset() + buffer.position(), remaining);
5050
} else {
5151
buffer.mark();
5252
int copyThreshold = buf.length;

0 commit comments

Comments
 (0)