Alternative to ByteBuffer.array()