Convert ByteBuffer to byte[] array instead of using CharBuffer