The list of methods to do ByteBuffer Set are organized into topic(s).
void
arrayCopy(ByteBuffer buffer, int position, byte[] bytes, int offset, int length) array Copy
if (buffer.hasArray())
System.arraycopy(buffer.array(), buffer.arrayOffset() + position, bytes, offset, length);
else
((ByteBuffer) buffer.duplicate().position(position)).get(bytes, offset, length);
Collection
base64FormatOfBinarySet(Collection bs)
Returns a base-64 string of the given bytes
List<String> base64Strings = new LinkedList<String>();
for (ByteBuffer b : bs) {
base64Strings.add(base64Format(b));
return base64Strings;
String
byteBuffersToString(ByteBuffer[] bufs, Charset cs) byte Buffers To String
CharsetDecoder cd = cs.newDecoder();
int len = 0;
for (ByteBuffer buf : bufs) {
len += buf.remaining();
int en = (int) (len * (double) cd.maxCharsPerByte());
char[] ca = new char[en];
cd.reset();
...
int
byteIndexOf(ByteBuffer buffer, byte[] temp, int offset) byte Index Of
int i;
if (temp.length == 0) {
return 0;
int end = buffer.limit() - temp.length;
if (end < 0) {
return -1;
int start = buffer.position() + offset;
if (start > end) {
return -1;
if (start < 0) {
start = 0;
byte[] b = buffer.array();
Search: for (i = start; i < end; i++) {
if (b[i] != temp[0]) {
continue;
int k = 1;
while (k < temp.length) {
if (b[k + i] != temp[k]) {
continue Search;
k++;
return i;
return -1;