code: private int readSBits(int numBits) throws IOException
      {
          // Get the number as an unsigned value.
          long uBits = readUBits( numBits );
  
          // Is the number negative?
          if( ( uBits & (1L << (numBits - 1))) != 0 )
          {
              // Yes. Extend the sign.
              uBits |= -1L << numBits;
          }
  
          return (int)uBits;        
      }
docs: Read a signed integer value from input.
  @param numBits number of bits to read