-
-
Save xyzz/cc4f71bacc8a63a53e53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def read_something(stream, length): | |
return int.from_bytes(stream.read(length), byteorder="big") | |
def read_int(stream): | |
return read_something(stream, 4) | |
def read_byte(stream): | |
return read_something(stream, 1) | |
def read_short(stream): | |
return read_something(stream, 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment