Skip to content

Instantly share code, notes, and snippets.

@epicfaace
Created August 17, 2022 00:05
Show Gist options
  • Save epicfaace/56452ffa0522317092d33a58398f0d40 to your computer and use it in GitHub Desktop.
Save epicfaace/56452ffa0522317092d33a58398f0d40 to your computer and use it in GitHub Desktop.
def peek(self, size: int):
b = bytearray()
for i in range(0, min(size, len(self.__buf))):
b.extend(self.__buf[i])
return bytes(b)[:size]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment