Wrap read request, concatenating partial reads until whole request have been read
This commit is contained in:
parent
e98a035540
commit
2e7e9f9759
|
@ -192,6 +192,15 @@ class FileLike:
|
|||
def flush(self):
|
||||
pass
|
||||
|
||||
def read(self, length):
|
||||
result = ''
|
||||
while len(result) < length:
|
||||
data = self.o.read(length)
|
||||
if not data:
|
||||
break
|
||||
result += data
|
||||
return result
|
||||
|
||||
def readline(self):
|
||||
result = ''
|
||||
while True:
|
||||
|
|
Loading…
Reference in New Issue