diff --git a/pom.xml b/pom.xml index 03e5642..3367e21 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ nl.andrewl record-net - 1.3.1 + 1.3.2 17 diff --git a/src/main/java/nl/andrewl/record_net/util/ExtendedDataInputStream.java b/src/main/java/nl/andrewl/record_net/util/ExtendedDataInputStream.java index 7a6ab0a..768b8e0 100644 --- a/src/main/java/nl/andrewl/record_net/util/ExtendedDataInputStream.java +++ b/src/main/java/nl/andrewl/record_net/util/ExtendedDataInputStream.java @@ -56,7 +56,12 @@ public class ExtendedDataInputStream extends DataInputStream { public byte[] readByteArray() throws IOException { int length = readInt(); if (length < 0) return null; - return readNBytes(length); + byte[] array = new byte[length]; + int readCount = read(array, 0, length); + while (readCount < length) { + readCount += read(array, readCount, length - readCount); + } + return array; } public int[] readIntArray() throws IOException {