botocore icon indicating copy to clipboard operation
botocore copied to clipboard

Add readinto to StreamingBody

Open aJanuary opened this issue 3 years ago • 0 comments

This adds a readinto implementation to StreamingBody, following the contract outlined in the Python io package.

The primary motivation for this is that it allows consumers to wrap the StreamingBody in an io.BufferedReader. This provides a nice performance boost for parsing streaming binary data formats, where you want to be able to read small numbers of bytes in your parsing algorithm, but benefit from reading large chunks of data from upstream.

aJanuary avatar Aug 23 '22 15:08 aJanuary