diff --git a/pom.xml b/pom.xml
index 43608d6..03e5642 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
nl.andrewl
record-net
- 1.3.0
+ 1.3.1
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 776ed0d..7a6ab0a 100644
--- a/src/main/java/nl/andrewl/record_net/util/ExtendedDataInputStream.java
+++ b/src/main/java/nl/andrewl/record_net/util/ExtendedDataInputStream.java
@@ -56,10 +56,7 @@ public class ExtendedDataInputStream extends DataInputStream {
public byte[] readByteArray() throws IOException {
int length = readInt();
if (length < 0) return null;
- byte[] array = new byte[length];
- int readLength = read(array);
- if (readLength != length) throw new IOException("Could not read complete byte array.");
- return array;
+ return readNBytes(length);
}
public int[] readIntArray() throws IOException {