From b41ac209cf65f7a6a0a32c0d93b6ae0e7e4dcb39 Mon Sep 17 00:00:00 2001 From: Jonathan Ellis Date: Fri, 29 Sep 2023 15:45:32 -0500 Subject: [PATCH] update position correctly after reading fewer than length bytes --- .../java/io/github/jbellis/jvector/example/util/MMapReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jvector-examples/src/main/java/io/github/jbellis/jvector/example/util/MMapReader.java b/jvector-examples/src/main/java/io/github/jbellis/jvector/example/util/MMapReader.java index 64de04f3d..e62f12969 100644 --- a/jvector-examples/src/main/java/io/github/jbellis/jvector/example/util/MMapReader.java +++ b/jvector-examples/src/main/java/io/github/jbellis/jvector/example/util/MMapReader.java @@ -37,7 +37,7 @@ private void read(byte[] bytes, int offset, int count) { try { buffer.memory().getBytes(position, bytes, offset, count); } finally { - position += bytes.length; + position += count; } }