我正在浏览一些Java代码并且正在考虑这个......
public static int readVInt(InputStream in) throws IOException {
byte b = (byte)in.read();
if(b == (byte) 0x80)
throw new RuntimeException("Attempting to read null value as int");
int value = b & 0x7F;
while ((b & 0x80) != 0) {
b = (byte)in.read();
value <<= 7;
value |= (b & 0x7F);
}
return value;
}
赢得的价值永远是b而且赢了,而且总是返回0?任何探索,因为我不理解它。
谢谢!