I am working in Android. I need to convert byte[] to Buffer type. In Android, I have seen a type Buffered that I needed to use in particular functions. But, I my data source is type byte[].
Take a look at ByteBuffer.wrap:
byte[] bytes = ...;
Buffer buf = ByteBuffer.wrap(bytes);
There’s also a ByteBuffer.wrap(byte[] array, int start, int byteCount)
if you only want to wrap part of an array.
Tags: javajava