code: public int read(final int length)
  		throws DecodingException
  	{
  
  		if (length > 31) {
  			throw ErrorFactory.createDecodingException(
  					ErrorKeys.DIFFTOOL_DECODING_VALUE_OUT_OF_RANGE,
  					"more than maximum length: " + length);
  		}
  
  		int v, b = 0;
  		for (int i = length - 1; i >= 0; i--) {
  			v = readBit();
  			if (v == -1) {
  				if (i != length - 1) {
  					throw ErrorFactory
  							.createDecodingException(ErrorKeys.DIFFTOOL_DECODING_UNEXPECTED_END_OF_STREAM);
  				}
  
  				return -1;
  			}
  			b |= v << i;
  		}
  
  		return b;
  	}
docs: Reads the next length-bits from the input.
  
  The maximum value of bits that could be read is 31. (Maximum value of a
  positive number that could be stored in an integer without any
  conversion.)
  
  @param length
  number of bits to read
  @return content as integer value or -1 if the end of the stream has been
  reached
  
  @throws DecodingException
  if the decoding failed