Skip to content

Commit

Permalink
default toIntArray
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe7s committed Sep 5, 2024
1 parent 368197f commit d2fe77e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ default int write(final byte[] bytes) {
return write(bytes, 0);
}

int[] toIntArray();
default int[] toIntArray() {
final byte[] data = data();
final int[] d = new int[data.length];
for (int i = 0; i < d.length; ++i) {
d[i] = data[i] & 0xff;
}
return d;
}

default int write(final byte[] bytes, final int i) {
final byte[] data = data();
Expand Down

0 comments on commit d2fe77e

Please sign in to comment.