So i have coded something to test the ByteBuffer wrap function:
byte[] cArr = ..
System.out.println("cArr length is " + cArr.length);
ByteBuffer e = ByteBuffer.wrap(cArr, 0, cArr.length );
System.out.println("e length is " + e.array().length);
ByteBuffer d = ByteBuffer.wrap(cArr, 4, 8 );
System.out.println("d length is " + d.array().length);
This is the output:
cArr length is 12
e length is 12
d length is 12
Why is the length of d still 12 even after wrapping and specifying length 8?