#NEWLINE# def _read_header( self ) : #NEWLINE# #INDENT# comm ( 'reading header' ) #NEWLINE# self . _header_buf += self . read ( 4 ) #NEWLINE# if ( len ( self . _header_buf ) == 4 ) : #NEWLINE# #INDENT# self . _header_complete = True #NEWLINE# try : #NEWLINE# #INDENT# header = struct . unpack ( '=I' , header . _header_buf ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# header = struct . unpack ( '=I' , self . _header_buf . data ( ) ) #NEWLINE# #UNINDENT# self . _to_read = header [ 0 ] #NEWLINE# self . _header_buf = bytes ( ) #NEWLINE# comm ( 'header content: %d' , self . _to_read )