Skip to content

Commit f28b1ef

Browse files
ctruedengab1one
authored andcommitted
DataHandle: improve readUTF implementation
Better to lean on the Java standard library here.
1 parent ad35207 commit f28b1ef

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main/java/org/scijava/io/DataHandle.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,7 @@ default String readLine() throws IOException {
572572

573573
@Override
574574
default String readUTF() throws IOException {
575-
final int length = readUnsignedShort();
576-
final byte[] b = new byte[length];
577-
read(b);
578-
return new String(b, "UTF-8");
575+
return DataInputStream.readUTF(this);
579576
}
580577

581578
// -- DataOutput methods --

0 commit comments

Comments
 (0)