/** Read an {@code sint32} field value from the stream. */ public int readVarSignedInt() throws IOException { return decodeZigZag32(readVarInt()); }
public void writeVarSignedInt(int value) throws IOException { writeVarInt(encodeZigZag32(value)); }
/** * Compute the number of bytes that would be needed to encode a signed varint. */ public static int computeVarSignedIntSize(int value) { return computeVarIntSize(encodeZigZag32(value)); }
/** * Compute the number of bytes that would be needed to encode a signed varint. */ public static int computeVarSignedLongSize(long value) { return computeVarLongSize(encodeZigZag64(value)); } }
/** Read an {@code sint64} field value from the stream. */ public long readVarSignedLong() throws IOException { return decodeZigZag64(readVarLong()); }
public void writeVarSignedLong(long value) throws IOException { writeVarLong(encodeZigZag64(value)); }
public int readVarInt() throws IOException { return helper.readVarInt(); }
public void writeVarInt(int value) throws IOException { helper.writeVarInt(value); }
byte tmp = readByte(); if (tmp >= 0) { return tmp; if ((tmp = readByte()) >= 0) { result |= tmp << 7; } else { result |= (tmp & 0x7f) << 7; if ((tmp = readByte()) >= 0) { result |= tmp << 14; } else { result |= (tmp & 0x7f) << 14; if ((tmp = readByte()) >= 0) { result |= tmp << 21; } else { result |= (tmp & 0x7f) << 21; result |= (tmp = readByte()) << 28; if (tmp < 0) { if (readByte() >= 0) return result;
public long readVarLong() throws IOException { return helper.readVarLong(); }
/** * Compute the number of bytes that would be needed to encode a signed varint. */ public static int computeVarSignedLongSize(long value) { return computeVarLongSize(encodeZigZag64(value)); } }
/** Read an {@code sint64} field value from the stream. */ public long readVarSignedLong() throws IOException { return decodeZigZag64(readVarLong()); }
public void writeVarSignedLong(long value) throws IOException { writeVarLong(encodeZigZag64(value)); }
public int readVarInt() throws IOException { return helper.readVarInt(); }
public void writeVarInt(int value) throws IOException { helper.writeVarInt(value); }
byte tmp = readByte(); if (tmp >= 0) { return tmp; if ((tmp = readByte()) >= 0) { result |= tmp << 7; } else { result |= (tmp & 0x7f) << 7; if ((tmp = readByte()) >= 0) { result |= tmp << 14; } else { result |= (tmp & 0x7f) << 14; if ((tmp = readByte()) >= 0) { result |= tmp << 21; } else { result |= (tmp & 0x7f) << 21; result |= (tmp = readByte()) << 28; if (tmp < 0) { if (readByte() >= 0) return result;
public long readVarLong() throws IOException { return helper.readVarLong(); }
/** Read an {@code sint32} field value from the stream. */ public int readVarSignedInt() throws IOException { return decodeZigZag32(readVarInt()); }
public void writeVarSignedInt(int value) throws IOException { writeVarInt(encodeZigZag32(value)); }
/** * Compute the number of bytes that would be needed to encode a signed varint. */ public static int computeVarSignedLongSize(long value) { return computeVarLongSize(encodeZigZag64(value)); } }