parameters: (f)
return_statement: return decode_long(data)
docstring: r"""
      >>> import StringIO
      >>> read_long1(StringIO.StringIO("\x00"))
      0L
      >>> read_long1(StringIO.StringIO("\x02\xff\x00"))
      255L
      >>> read_long1(StringIO.StringIO("\x02\xff\x7f"))
      32767L
      >>> read_long1(StringIO.StringIO("\x02\x00\xff"))
      -256L
      >>> read_long1(StringIO.StringIO("\x02\x00\x80"))
      -32768L
docstring_summary: r"""
      >>> import StringIO
      >>> read_long1(StringIO.StringIO("\x00"))
      0L
      >>> read_long1(StringIO.StringIO("\x02\xff\x00"))
      255L
      >>> read_long1(StringIO.StringIO("\x02\xff\x7f"))
      32767L
      >>> read_long1(StringIO.StringIO("\x02\x00\xff"))
      -256L
      >>> read_long1(StringIO.StringIO("\x02\x00\x80"))
      -32768L
docstring_tokens: r >>> import StringIO >>> read_long1 ( StringIO . StringIO ( \ x00 )) 0L >>> read_long1 ( StringIO . StringIO ( \ x02 \ xff \ x00 )) 255L >>> read_long1 ( StringIO . StringIO ( \ x02 \ xff \ x7f )) 32767L >>> read_long1 ( StringIO . StringIO ( \ x02 \ x00 \ xff )) - 256L >>> read_long1 ( StringIO . StringIO ( \ x02 \ x00 \ x80 )) - 32768L
function: def read_long1(f):
      r"""
      >>> import StringIO
      >>> read_long1(StringIO.StringIO("\x00"))
      0L
      >>> read_long1(StringIO.StringIO("\x02\xff\x00"))
      255L
      >>> read_long1(StringIO.StringIO("\x02\xff\x7f"))
      32767L
      >>> read_long1(StringIO.StringIO("\x02\x00\xff"))
      -256L
      >>> read_long1(StringIO.StringIO("\x02\x00\x80"))
      -32768L
      """
  
      n = read_uint1(f)
      data = f.read(n)
      if len(data) != n:
          raise ValueError("not enough data in stream to read long1")
      return decode_long(data)
function_tokens: def read_long1 ( f ) : n = read_uint1 ( f ) data = f . read ( n ) if len ( data ) != n : raise ValueError ( "not enough data in stream to read long1" ) return decode_long ( data )