code: static public int unpackInt(InputStream in) throws IOException {
          int ret = 0;
          int v;
          do{
              v = in.read();
              if(v==-1)
                  throw new EOFException();
              ret = (ret<<7 ) | (v & 0x7F);
          }while((v&0x80)==0);
  
          return ret;
      }
docs: Unpack int value from the input stream.
  
  @param in The input stream.
  @return The long value.
  
  @throws java.io.IOException in case of IO error