Retrieve decoded size from snappy encoded data without decoding #488
Answered
by
klauspost
tanner-bruce
asked this question in
Q&A
-
In grpc-go it's possible to help optimize the allocations during message decoding by providing the decoded size up front. Is it possible to do this with this library? |
Beta Was this translation helpful? Give feedback.
Answered by
klauspost
Feb 3, 2022
Replies: 1 comment 1 reply
-
For snappy blocks you can use DecodedLen. For streams you can use IndexStream which you can Load to get the TotalUncompressed size. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
klauspost
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For snappy blocks you can use DecodedLen.
For streams you can use IndexStream which you can Load to get the TotalUncompressed size.