parameters: (self, size)
return_statement: return ret
docstring: Reads an integer of the given size (in bytes).
docstring_summary: Reads an integer of the given size (in bytes).
docstring_tokens: Reads an integer of the given size ( in bytes ) .
function: def read_int(self, size):
      """Reads an integer of the given size (in bytes)."""
      data = self.read_bytes(size)
      ret = 0
      for i in range(0, size):
        if self.little_endian:
          ret |= (ord(data[i]) << (8 * i))
        else:
          ret |= (ord(data[i]) << (8 * (size - i - 1)))
      return ret
function_tokens: def read_int ( self , size ) : data = self . read_bytes ( size ) ret = 0 for i in range ( 0 , size ) : if self . little_endian : ret |= ( ord ( data [ i ] ) << ( 8 * i ) ) else : ret |= ( ord ( data [ i ] ) << ( 8 * ( size - i - 1 ) ) ) return ret