Changed how byte arrays are read.
This commit is contained in:
parent
d5507073f8
commit
e68f496302
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
|||
|
||||
<groupId>nl.andrewl</groupId>
|
||||
<artifactId>record-net</artifactId>
|
||||
<version>1.3.0</version>
|
||||
<version>1.3.1</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue