Example #1
0
 def __read(self, read, size):
     if size is None or size < 0:
         return MultibyteIncrementalDecoder.decode(self, read(), True)
     while True:
         data = read(size)
         final = not data
         output = MultibyteIncrementalDecoder.decode(self, data, final)
         if output or final:
             return output
         size = 1  # read 1 more byte and retry
Example #2
0
 def __read(self, read, size):
     if size is None or size < 0:
         return MultibyteIncrementalDecoder.decode(self, read(), True)
     while True:
         data = read(size)
         final = not data
         output = MultibyteIncrementalDecoder.decode(self, data, final)
         if output or final:
             return output
         size = 1   # read 1 more byte and retry
Example #3
0
 def __new__(cls, stream, errors=None):
     self = MultibyteIncrementalDecoder.__new__(cls, errors)
     self.stream = stream
     return self
Example #4
0
 def __new__(cls, stream, errors=None):
     self = MultibyteIncrementalDecoder.__new__(cls, errors)
     self.stream = stream
     return self