if (isPosFixInt(b)) { return POSFIXINT; if (isNegFixInt(b)) { return NEGFIXINT; if (isFixStr(b)) { return FIXSTR; if (isFixedArray(b)) { return FIXARRAY; if (isFixedMap(b)) { return FIXMAP;
public static boolean isMap(byte b) { return isFixedMap(b) || b == MAP16 || b == MAP32; }
public boolean isCurrentResultAMap(DirectBuffer document) { final byte headerByte = document.getByte(currentResultPosition()); return MsgPackCodes.isMap(headerByte); }
public int readArrayHeader() { final byte headerByte = buffer.getByte(offset); ++offset; final int mapSize; if (isFixedArray(headerByte)) { mapSize = headerByte & (byte) 0x0F; } else { switch (headerByte) { case ARRAY16: mapSize = buffer.getShort(offset, BYTE_ORDER) & 0xffff; offset += SIZE_OF_SHORT; break; case ARRAY32: mapSize = (int) ensurePositive(buffer.getInt(offset, BYTE_ORDER)); offset += SIZE_OF_INT; break; default: throw exceptionOnUnknownHeader("array", headerByte); } } return mapSize; }
public int readStringLength() { final byte headerByte = buffer.getByte(offset); ++offset; final int stringLength; if (isFixStr(headerByte)) { stringLength = headerByte & (byte) 0x1F; } else { switch (headerByte) { case STR8: stringLength = buffer.getByte(offset) & 0xff; ++offset; break; case STR16: stringLength = buffer.getShort(offset, BYTE_ORDER) & 0xffff; offset += SIZE_OF_SHORT; break; case STR32: stringLength = (int) ensurePositive(buffer.getInt(offset, BYTE_ORDER)); offset += SIZE_OF_INT; break; default: throw exceptionOnUnknownHeader("string", headerByte); } } return stringLength; }
public static boolean isMap(byte b) { return isFixedMap(b) || b == MAP16 || b == MAP32; }
public boolean isCurrentResultAMap(DirectBuffer document) { final byte headerByte = document.getByte(currentResultPosition()); return MsgPackCodes.isMap(headerByte); }
public int readArrayHeader() { final byte headerByte = buffer.getByte(offset); ++offset; final int mapSize; if (isFixedArray(headerByte)) { mapSize = headerByte & (byte) 0x0F; } else { switch (headerByte) { case ARRAY16: mapSize = buffer.getShort(offset, BYTE_ORDER) & 0xffff; offset += SIZE_OF_SHORT; break; case ARRAY32: mapSize = (int) ensurePositive(buffer.getInt(offset, BYTE_ORDER)); offset += SIZE_OF_INT; break; default: throw exceptionOnUnknownHeader("array", headerByte); } } return mapSize; }
public int readStringLength() { final byte headerByte = buffer.getByte(offset); ++offset; final int stringLength; if (isFixStr(headerByte)) { stringLength = headerByte & (byte) 0x1F; } else { switch (headerByte) { case STR8: stringLength = buffer.getByte(offset) & 0xff; ++offset; break; case STR16: stringLength = buffer.getShort(offset, BYTE_ORDER) & 0xffff; offset += SIZE_OF_SHORT; break; case STR32: stringLength = (int) ensurePositive(buffer.getInt(offset, BYTE_ORDER)); offset += SIZE_OF_INT; break; default: throw exceptionOnUnknownHeader("string", headerByte); } } return stringLength; }
if (isPosFixInt(b)) { return POSFIXINT; if (isNegFixInt(b)) { return NEGFIXINT; if (isFixStr(b)) { return FIXSTR; if (isFixedArray(b)) { return FIXARRAY; if (isFixedMap(b)) { return FIXMAP;
public int readMapHeader() { final byte headerByte = buffer.getByte(offset); ++offset; final int mapSize; if (isFixedMap(headerByte)) { mapSize = headerByte & (byte) 0x0F; } else { switch (headerByte) { case MAP16: mapSize = buffer.getShort(offset, BYTE_ORDER) & 0xffff; offset += SIZE_OF_SHORT; break; case MAP32: mapSize = (int) ensurePositive(buffer.getInt(offset, BYTE_ORDER)); offset += SIZE_OF_INT; break; default: throw exceptionOnUnknownHeader("map", headerByte); } } return mapSize; }
public int readMapHeader() { final byte headerByte = buffer.getByte(offset); ++offset; final int mapSize; if (isFixedMap(headerByte)) { mapSize = headerByte & (byte) 0x0F; } else { switch (headerByte) { case MAP16: mapSize = buffer.getShort(offset, BYTE_ORDER) & 0xffff; offset += SIZE_OF_SHORT; break; case MAP32: mapSize = (int) ensurePositive(buffer.getInt(offset, BYTE_ORDER)); offset += SIZE_OF_INT; break; default: throw exceptionOnUnknownHeader("map", headerByte); } } return mapSize; }