fix incorrect usage of ByteBuffer.array()