From ccbbf6b512351f94ad47326566341f8afb2771f6 Mon Sep 17 00:00:00 2001 From: TheMode Date: Tue, 21 Sep 2021 10:17:33 +0200 Subject: [PATCH] Fix BinaryBuffer#canRead Signed-off-by: TheMode --- .../java/net/minestom/server/utils/binary/BinaryBuffer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/utils/binary/BinaryBuffer.java b/src/main/java/net/minestom/server/utils/binary/BinaryBuffer.java index c96ec6020..05cafa9eb 100644 --- a/src/main/java/net/minestom/server/utils/binary/BinaryBuffer.java +++ b/src/main/java/net/minestom/server/utils/binary/BinaryBuffer.java @@ -79,7 +79,7 @@ public final class BinaryBuffer { } public boolean canRead(int size) { - return readerOffset + size < capacity; + return readerOffset + size <= writerOffset; } public boolean canWrite(int size) {