Skip to content

Commit 4839171

Browse files
ctruedengab1one
authored andcommitted
DataHandle: relocate DataInput methods
Now they match their declared order in DataInput.
1 parent fcb164e commit 4839171

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,21 @@ default long skip(final long n) throws IOException {
440440
// -- DataInput methods --
441441

442442
@Override
443-
default boolean readBoolean() throws IOException {
444-
return readByte() != 0;
443+
default void readFully(final byte[] b) throws IOException {
444+
readFully(b, 0, b.length);
445445
}
446446

447447
@Override
448-
default void readFully(final byte[] b) throws IOException {
449-
readFully(b, 0, b.length);
448+
default int skipBytes(final int n) throws IOException {
449+
final int skip = (int) Math.min(n, length() - offset());
450+
if (skip < 0) return 0;
451+
seek(offset() + skip);
452+
return skip;
453+
}
454+
455+
@Override
456+
default boolean readBoolean() throws IOException {
457+
return readByte() != 0;
450458
}
451459

452460
@Override
@@ -555,14 +563,6 @@ default String readUTF() throws IOException {
555563
return new String(b, "UTF-8");
556564
}
557565

558-
@Override
559-
default int skipBytes(final int n) throws IOException {
560-
final int skip = (int) Math.min(n, length() - offset());
561-
if (skip < 0) return 0;
562-
seek(offset() + skip);
563-
return skip;
564-
}
565-
566566
// -- DataOutput methods --
567567

568568
@Override

0 commit comments

Comments
 (0)