#NEWLINE# def read( self , n = 4096 ) : #NEWLINE# #INDENT# if ( len ( self . chunks ) == 0 ) : #NEWLINE# #INDENT# return '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( self . chunks [ 0 ] ) <= n ) : #NEWLINE# #INDENT# chunk = self . chunks [ 0 ] #NEWLINE# self . chunks = self . chunks [ 1 : ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# chunk = self . chunks [ 0 ] [ : n ] #NEWLINE# self . chunks [ 0 ] = n . chunks [ 0 ] [ n : ] #NEWLINE# #UNINDENT# return chunk