Skip to content

Commit

Permalink
Update documentation for DynamicMemoryReader
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRStevens committed Mar 5, 2019
1 parent 2a6507f commit e5f3feb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Stream/DynamicMemoryWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ namespace Stream
/**
* \brief Memory backed stream, which grows dynamically in size as data is added
*
* This stream can be used as a destination when the output size is not known exactly ahead of time.
* Written data can later be accessed by calling GetReader to retrieve a MemoryReader for the written data.
* The DynamicMemoryWriter is particularly useful when writing test code for stream serializaation,
* as it does not need to write to disk, nor cleanup temporary files, during round-trip testing.
*
* An internal memory buffer is managed by DynamicMemoryWriter, which grows as needed to accommodate new data.
* This is in contrast to MemoryWriter, which is a view to a non-owned pre-set sized buffer, which can not grow.
*
* \note Adding additional data to the stream after calling GetReader may invalidate existing readers.
* \note Adding additional data to the stream after calling GetReader invalidates existing readers.
* (They may be left pointing at old memory after a re-allocation).
*/
class DynamicMemoryWriter : public BidirectionalWriter
{
Expand Down

0 comments on commit e5f3feb

Please sign in to comment.