Bases: object
An abstract reader of bytes. Note that due to endianness concerns, the methods of this reader should be used directly for the appropriate data type being read; e.g. an int should be written using read_int rather than calling read_byte 4 times unless a specific endianness is being achieved.
Abstract Methods
| is_at_end() | returns true if the reader is currently at the end of the byte |
| read_byte() | Reads the next byte |
| read_int() | Read the next four bytes as in int value |
| read_long() | Reads the next eight bytes as a long value |
| read_short() | Reads the next two bytes as a short value |
Methods
| read_bytes([size]) | Reads an array of bytes |
Detailed Methods
returns true if the reader is currently at the end of the byte reader
| Returns: | returns true if the reader is currently at the end of the byte |
|---|
reader false otherwise :rtype: bool
Reads the next byte
| Returns: | A byte |
|---|---|
| Return type: | int |
| Raises: |
|
Reads an array of bytes
| Parameters: | size (int) – The number of bytes to read, or None to read all of the remaining bytes |
|---|---|
| Returns: | An array of bytes |
| Return type: | bytearray |
| Raises: |
|
Read the next four bytes as in int value
| Returns: | An int |
|---|---|
| Return type: | int |
| Raises: |
|