Some more comments

This commit is contained in:
Sybren A. Stüvel 2018-02-28 11:16:58 +01:00
parent 65b690e998
commit a5bc52523d

View File

@ -5,6 +5,7 @@ import typing
class EndianIO:
# TODO(Sybren): note as UCHAR: struct.Struct = None and move actual structs to LittleEndianTypes
UCHAR = struct.Struct(b'<B')
USHORT = struct.Struct(b'<H')
USHORT2 = struct.Struct(b'<HH') # two shorts in a row
@ -66,6 +67,9 @@ class EndianIO:
The string will always be written 0-terminated.
:param fileobj: the file to write to.
:param astring: the string to write.
:param fieldlen: the field length in bytes.
:returns: the number of bytes written.
"""
assert isinstance(astring, str)