Skip to content

Commit a72eca7

Browse files
authored
Merge pull request #25 from KosmX/master
Yet another ByteBuffer related java 1.8 bug
2 parents 34565b7 + bfc7054 commit a72eca7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ public void transferTo(OutputStream out, byte[] buf) throws IOException {
6565
if (buffer.hasArray()) {
6666
out.write(buffer.array(), buffer.arrayOffset() + buffer.position(), remaining);
6767
} else {
68-
buffer.mark();
68+
((Buffer)buffer).mark();
6969
int copyThreshold = buf.length;
7070
while (remaining != 0) {
7171
int length = Math.min(copyThreshold, remaining);
7272
buffer.get(buf, 0, length);
7373
out.write(buf, 0, length);
7474
remaining -= length;
7575
}
76-
buffer.reset();
76+
((Buffer)buffer).reset();
7777
}
7878
}
7979

src/main/java/software/coley/lljzip/util/ByteDataUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ public static byte[] readArray(ByteData data, int start, int len) {
299299
public static ByteBuffer sliceExact(ByteBuffer data, int start, int end) {
300300
ByteBuffer slice = data.slice();
301301
slice = ((ByteBuffer) ((Buffer)slice).position(start)).slice();
302-
slice.limit(end - start);
302+
((Buffer)slice).limit(end - start);
303303
return slice.order(data.order());
304304
}
305305

0 commit comments

Comments
 (0)