Skip to content
Discussion options

You must be logged in to vote

self._data_buffer[0:4] creates a new bytearray object, which is different form buffer. So it you read into that one, buffer is not changed. It should work using memoryview, which creates an object which effectively is part of buffer. Not tested:

mv = memoryview(buffer)
then use readinto with mv[0:4] as argument.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dobodu
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants