Open akirarat opened 7 years ago
Since reader is just a BufferedReader. self.read() will return a byte array. We should convert this into a UTF-8 string.
def read_string(self): length = self.read_int() if length == pow(2, 32) - 1: return b"" else: try: decoded = self.read(length) except MemoryError: raise IndexError("String out of range.") else: return decoded
Since reader is just a BufferedReader. self.read() will return a byte array. We should convert this into a UTF-8 string.