List of utility methods to do ByteBuffer Write
void | writeInt24(int v, ByteBuffer buffer) write Int writeByte(v, buffer); writeByte(v >> 8, buffer); writeByte(v >> 16, buffer); |
int | writeInt4(final ByteBuffer bb, int value, int highValue, final boolean flush) write Int int nibbleL; int nibbleH; if (highValue > 0) { highValue &= 0x70; nibbleL = value & 7; value >>>= 3; if (value != 0) { nibbleL |= 8; ... |
void | writeInt8(final ByteBuffer bb, int value) write Int int octet; do { octet = value & 0x7F; value >>>= 7; if (value != 0) { octet |= 0x80; bb.put((byte) octet); ... |
void | writeIntArray(ByteBuffer buf, int[] arr) write Int Array final int size = arr.length; buf.putInt(size); for (int i = 0; i < size; i++) { buf.putInt(arr[i]); |
void | writeInts4(final ByteBuffer bb, final int... values) write Ints writeInts4(bb, values, 0, values.length); |
void | writeL(ByteBuffer to, ByteBuffer from, int count) write L if (from.hasArray()) { to.put(from.array(), from.arrayOffset() + from.position(), Math.min(from.remaining(), count)); } else { to.put(toArrayL(from, count)); |
int | writeLen(int len, ByteBuffer dest, int dOff) write Len while (len >= 0xFF) { dest.put(dOff++, (byte) 0xFF); len -= 0xFF; dest.put(dOff++, (byte) len); return dOff; |
void | writeLength(ByteBuffer buffer, long l) write Length if (l < 251) { buffer.put((byte) l); } else if (l < 0x10000L) { buffer.put((byte) 252); writeUB2(buffer, (int) l); } else if (l < 0x1000000L) { buffer.put((byte) 253); writeUB3(buffer, (int) l); ... |
void | writeLong(ByteBuffer buf, long value, int len) write Long for (int i = 0; i < len; i++) { buf.put((byte) ((value >>> (i << 3)) & 0xff)); |
void | writeLong(ByteBuffer logBuf, long l) Write a long into the log. byte b = (byte) (l >>> 0); logBuf.put(b); b = (byte) (l >>> 8); logBuf.put(b); b = (byte) (l >>> 16); logBuf.put(b); b = (byte) (l >>> 24); logBuf.put(b); ... |