The list of methods to do ByteBuffer Read are organized into topic(s).
int
c_read(Channel fd, ByteBuffer buffer, int count) read
try {
ReadableByteChannel rc = (ReadableByteChannel) fd;
buffer = buffer.duplicate();
buffer.limit(buffer.position() + count);
return rc.read(buffer);
} catch (Exception e) {
e.printStackTrace();
return -1;
...
String
contentOfUnreadBuffer(final ByteBuffer buffer) content of unread byte buffer, hex representation using ByteBuffer#getInt()
int position = buffer.position();
int limit = buffer.limit();
StringBuffer sb = new StringBuffer();
while (buffer.hasRemaining()) {
sb.append(Integer.toHexString(buffer.getInt()));
buffer.position(position);
buffer.limit(limit);
...
ByteBuffer
enlargeThreadLocalByteBuffer() Double the thread local buffer capacity.
TMP_BUFFER.set(ByteBuffer.allocate(TMP_BUFFER.get().capacity() * 2));
return TMP_BUFFER.get();