diff --git a/src/main/java/de/tudbut/io/TypedInputStream.java b/src/main/java/de/tudbut/io/TypedInputStream.java index c5f2459..8ee3b8a 100644 --- a/src/main/java/de/tudbut/io/TypedInputStream.java +++ b/src/main/java/de/tudbut/io/TypedInputStream.java @@ -119,7 +119,7 @@ public class TypedInputStream { public byte[] readByteArray() throws IOException { byte[] bytes = new byte[readInt()]; int n = 0; - while ((n += stream.read(bytes, n, bytes.length - n)) != 0); + while (n != (n += stream.read(bytes, n, bytes.length - n))); if(n != bytes.length) { byte[] cutBytes = new byte[n]; System.arraycopy(bytes, 0, cutBytes, 0, n);