Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static int readVLI(RandomAccessFile din) throws IOException{
- boolean isNegative = false;
- int b = 0;
- int offset = 6;
- int result;
- b = din.read();
- if((b & 0b01000000) != 0) isNegative = true;
- result = (b & 0b00111111);
- while((b & 0b10000000) != 0){
- b = (din.read() & 0b01111111);
- b = b << offset;
- result += b;
- offset += 7;
- }
- if(isNegative) result *= -1;
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement