#NEWLINE# def _read_limited( self , size = None ) : #NEWLINE# #INDENT# if ( ( size is None ) or ( size > self . remaining ) ) : #NEWLINE# #INDENT# size = self . remaining #NEWLINE# #UNINDENT# if ( size == 0 ) : #NEWLINE# #INDENT# return b'' #NEWLINE# #UNINDENT# result = self . stream . read ( size ) #NEWLINE# self . remaining -= len ( result ) #NEWLINE# return result