@Override public int getValueLength(Slice slice, int offset) { return decodeVIntSize(slice, offset); }
@Override public int getValueLength(Slice slice, int offset) { return decodeVIntSize(slice, offset); }
@Override public int getValueOffset(Slice slice, int offset) { return decodeVIntSize(slice, offset); }
@Override public int getValueOffset(Slice slice, int offset) { return decodeVIntSize(slice, offset); }
@Override public int getValueLength(Slice slice, int offset) { // first vint is scale int scaleLength = decodeVIntSize(slice, offset); // second vint is data length int dataLengthLength = decodeVIntSize(slice, offset + scaleLength); int dataLength = toIntExact(readVInt(slice, offset + scaleLength)); return scaleLength + dataLengthLength + dataLength; }
public static int decodeVIntSize(Slice slice, int offset) { return decodeVIntSize(slice.getByte(offset)); }
@Override public int getValueLength(Slice slice, int offset) { int length = 4; if (hasNanosVInt(slice.getByte(offset))) { int nanosVintLength = decodeVIntSize(slice, offset + 4); length += nanosVintLength; // is there extra data for "seconds" if (isNegativeVInt(slice, offset + 4)) { length += decodeVIntSize(slice, offset + 4 + nanosVintLength); } } return length; }
public static long readVInt(Slice slice, int start) { byte firstByte = slice.getByte(start); int length = decodeVIntSize(firstByte); if (length == 1) { return firstByte; } return readVIntInternal(slice, start, length); }
public static long readVInt(SliceInput in) { byte firstByte = in.readByte(); int length = decodeVIntSize(firstByte); if (length == 1) { return firstByte; } long value = 0; for (int i = 1; i < length; i++) { value <<= 8; value |= (in.readByte() & 0xFF); } return isNegativeVInt(firstByte) ? ~value : value; }
offset += decodeVIntSize(slice.getByte(offset));
offset += decodeVIntSize(slice.getByte(offset));
@Override public int getValueOffset(Slice slice, int offset) { return decodeVIntSize(slice, offset); }
@Override public int getValueLength(Slice slice, int offset) { return decodeVIntSize(slice, offset); }
@Override public int getValueLength(Slice slice, int offset) { return decodeVIntSize(slice, offset); }
@Override public int getValueOffset(Slice slice, int offset) { return decodeVIntSize(slice, offset); }
@Override public int getValueLength(Slice slice, int offset) { // first vint is scale int scaleLength = decodeVIntSize(slice, offset); // second vint is data length int dataLengthLength = decodeVIntSize(slice, offset + scaleLength); int dataLength = toIntExact(readVInt(slice, offset + scaleLength)); return scaleLength + dataLengthLength + dataLength; }
public static int decodeVIntSize(Slice slice, int offset) { return decodeVIntSize(slice.getByte(offset)); }
@Override public int getValueLength(Slice slice, int offset) { int length = 4; if (hasNanosVInt(slice.getByte(offset))) { int nanosVintLength = decodeVIntSize(slice, offset + 4); length += nanosVintLength; // is there extra data for "seconds" if (isNegativeVInt(slice, offset + 4)) { length += decodeVIntSize(slice, offset + 4 + nanosVintLength); } } return length; }
public static long readVInt(Slice slice, int start) { byte firstByte = slice.getByte(start); int length = decodeVIntSize(firstByte); if (length == 1) { return firstByte; } return readVIntInternal(slice, start, length); }
public static long readVInt(SliceInput in) { byte firstByte = in.readByte(); int length = decodeVIntSize(firstByte); if (length == 1) { return firstByte; } long value = 0; for (int i = 1; i < length; i++) { value <<= 8; value |= (in.readByte() & 0xFF); } return isNegativeVInt(firstByte) ? ~value : value; }