Read up to ``size`` bytes, decode them using this reader's encoding, and return the resulting unicode string. :param size: The maximum number of bytes to read. If not specified, then read as many bytes as possible. :type size: int :rtype: unicod
(self, size=None)
| 1298 | # ///////////////////////////////////////////////////////////////// |
| 1299 | |
| 1300 | def read(self, size=None): |
| 1301 | """ |
| 1302 | Read up to ``size`` bytes, decode them using this reader's |
| 1303 | encoding, and return the resulting unicode string. |
| 1304 | |
| 1305 | :param size: The maximum number of bytes to read. If not |
| 1306 | specified, then read as many bytes as possible. |
| 1307 | :type size: int |
| 1308 | :rtype: unicode |
| 1309 | """ |
| 1310 | chars = self._read(size) |
| 1311 | |
| 1312 | # If linebuffer is not empty, then include it in the result |
| 1313 | if self.linebuffer: |
| 1314 | chars = "".join(self.linebuffer) + chars |
| 1315 | self.linebuffer = None |
| 1316 | self._rewind_numchars = None |
| 1317 | |
| 1318 | return chars |
| 1319 | |
| 1320 | def discard_line(self): |
| 1321 | if self.linebuffer and len(self.linebuffer) > 1: |