Commit Graph

5 Commits

Author SHA1 Message Date
dgelessus
8d39469e6e Wrap _io_utils.SubStream in an io.BufferedReader for performance
Although the underlying stream is already buffered, the extra
BufferedReader wrapper around the SubStream results in a noticeable
performance improvement.
2020-07-23 15:49:28 +02:00
dgelessus
98551263b3 Work around false mypy error about SubStream.__enter__ 2020-07-23 13:21:34 +02:00
dgelessus
126795239c Reimplement Resource.data_raw using a custom stream type (SubStream)
This way all reads performed on a resource data stream are forwarded
to the underlying resource file stream, with the read offsets and
lengths adjusted appropriately.
2020-07-23 02:42:32 +02:00
dgelessus
0f6018e4bf Move .compress.common.make_peekable and related code into ._io_utils 2020-07-19 23:16:36 +02:00
dgelessus
476a68916b Merge implementations of read_exact functions/methods
The old functions/methods still exist, so that they continue to raise
the same exceptions as before (which are different depending on
context), but they now use the same implementation internally.
2020-07-18 21:07:12 +02:00