Skip to content

Commit 5f4a4ae

Browse files
committed
Another ByteBuffer.position java 1.8 bug
1 parent 45c3c17 commit 5f4a4ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import software.coley.lljzip.util.lazy.LazyInt;
66
import software.coley.lljzip.util.lazy.LazyLong;
77

8+
import java.nio.Buffer;
89
import java.nio.ByteBuffer;
910
import java.nio.charset.StandardCharsets;
1011
import java.util.Objects;
@@ -297,7 +298,7 @@ public static byte[] readArray(ByteData data, int start, int len) {
297298
*/
298299
public static ByteBuffer sliceExact(ByteBuffer data, int start, int end) {
299300
ByteBuffer slice = data.slice();
300-
slice = ((ByteBuffer) slice.position(start)).slice();
301+
slice = ((ByteBuffer) ((Buffer)slice).position(start)).slice();
301302
slice.limit(end - start);
302303
return slice.order(data.order());
303304
}

0 commit comments

Comments
 (0)