fix incorrect usages of ByteBuffer.array()