ayushkarnawat / profit

Exploring evolutionary protein fitness landscapes
MIT License
1 stars 0 forks source link

Grow `datum_bytes` if record is too big to read with DEFAULT_BUFFER_SIZE #77

Closed ayushkarnawat closed 4 years ago

ayushkarnawat commented 4 years ago

Description

The bytearray.zfill(N) function creates a copy of the array filled with zeroes to N bytes. The source array remains unchanged. See: https://docs.python.org/3.6/library/stdtypes.html#str.zfill

With this change, the datum_bytes is reset to the extended array, effectively making the buffer size 1.5x greater than the required number of bytes needed to read the record.

Changes