datastream
Read and write binary files by integer, floats, strings with fixed size.
Installing
pip install python-datastream
Usage
Reading:
from datastream import DataInputStream
with open("test.bin", "rb") as f:
ds = DataInputStream(f)
print(ds.read_int())
print(ds.read_strz())
Writing:
from datastream import DataOutputStream
with open("test.bin", "wb") as f:
ds = DataOutputStream(f)
ds.write_int(42)
ds.write_strz("Hello world")
License
MIT License. See LICENSE file.