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;
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;
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;
/** Read a raw Varint from the stream. */ public long readVarLong() throws IOException { int shift = 0; long result = 0; while (shift < 64) { byte b = readByte(); result |= (long) (b & 0x7F) << shift; if ((b & 0x80) == 0) return result; shift += 7; } throw new ProtocolException("Encountered a malformed variable int"); }
/** Read a raw Varint from the stream. */ public long readVarLong() throws IOException { int shift = 0; long result = 0; while (shift < 64) { byte b = readByte(); result |= (long) (b & 0x7F) << shift; if ((b & 0x80) == 0) return result; shift += 7; } throw new ProtocolException("Encountered a malformed variable int"); }
/** Read a raw Varint from the stream. */ public long readVarLong() throws IOException { int shift = 0; long result = 0; while (shift < 64) { byte b = readByte(); result |= (long) (b & 0x7F) << shift; if ((b & 0x80) == 0) return result; shift += 7; } throw new ProtocolException("Encountered a malformed variable int"); }