Is it possible to get specific bytes from a byte array in java?
I have a byte array:
byte[] abc = new byte[512];
and i want to have 3 different byte arrays from this array.
- byte 0-127
- byte 128-255
- byte256-511.
I tried abc.read(byte[], offset,length)
but it works only if I give offset as 0, for any other value it throws an IndexOutOfbounds
exception.
What am I doing wrong?