List of utility methods to do ByteBuffer Get
ByteBuffer | getIncreasingByteBuffer(int len) get Increasing Byte Buffer return getIncreasingByteBuffer(0, len);
|
String | getIPv4String(ByteBuffer buffer) get I Pv String return (buffer.get() & 0xff) + "." + (buffer.get() & 0xff) + "." + (buffer.get() & 0xff) + "." + (buffer.get() & 0xff); |
String | getJagexString(ByteBuffer buf) Gets a null-terminated string from the specified buffer, using a modified ISO-8859-1 character set. StringBuilder bldr = new StringBuilder(); int b; while ((b = (buf.get() & 0xFF)) != 0) { if (b >= 127 && b < 160) { char curChar = CHARACTERS[b - 128]; if (curChar != 0) { bldr.append(curChar); } else { bldr.append((char) b); return bldr.toString(); |
byte[] | getJceBufArray(ByteBuffer buffer) get Jce Buf Array byte[] arrayOfByte = new byte[buffer.position()]; System.arraycopy(buffer.array(), 0, arrayOfByte, 0, arrayOfByte.length); return arrayOfByte; |
int | getLength(ByteBuffer buffer) get Length int i = ((int) buffer.get()) & 0xff; if ((i & ~0x7F) == 0) { return i; byte[] bytes = new byte[i & 0x7f]; buffer.get(bytes); return new BigInteger(1, bytes).intValue(); |
short | getLengthFromBuffer(ByteBuffer in) Extracts the length field from an ICP buffer. return in.getShort(OFFSET_SHORT_LENGTH);
|
List | getListFromByteBuffer(ByteBuffer data, List list from ByteBuffer return getListFromBytes(data.array(), classes);
|
int | getLTriad(ByteBuffer bb) get L Triad return (int) (bb.get() << 16 | bb.get() << 8 | bb.get()); |
double | getMean(ByteBuffer simulationResults) get Mean double sum = 0.0; int size = simulationResults.capacity() / 8; simulationResults.rewind(); for (int i = 0; i < size; i++) { double f = simulationResults.getDouble(); sum += f; return (sum / size); ... |
int | getMedium(ByteBuffer buffer) Gets a 24-bit medium integer from the specified ByteBuffer s current position and increases the buffers position by 3. return (buffer.getShort() & 0xFFFF) << 8 | buffer.get() & 0xFF;
|