Skip to content

Linking GNSSNTRIPClient and RTCMReader using in-memory stream with BytesIO #106

Answered by semuadmin
dgashby asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @dgashby,

Couple of issues with the code...

  1. Not sure BytesIO can be used in quite this way e.g. consider the following:
from io import BytesIO

b = BytesIO(b"1234")
print(b.getvalue())  # outputs b'1234'
print(b.read(2))  # outputs b'12'
print(b.read(2))  # outputs b'34'
print(b.read())  # outputs b''

b.write(b"5678")
print(b.getvalue())  # outputs b'12345678'
print(b.read())  # still outputs b''
  1. As per the API documentation, the GNSSNTRIPClient output argument supports the following specific writeable output media classes (intended to cover the most common use cases):
- BufferedWriter e.g. binary file, for raw data bytes
- TextIOWrapper e.g. text file, for parsed data as a strin…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dgashby
Comment options

Answer selected by dgashby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants