Base Framework
Public Member Functions | List of all members
MemoryOutputStream Class Reference

#include <base/io/MemoryOutputStream.h>

Inherits OutputStream.

Public Member Functions

 MemoryOutputStream (MemorySize capacity=16 *1024)
 
void swap (Allocator< uint8 > &buffer)
 
void flush () override
 
unsigned int write (const uint8 *src, unsigned int size, bool nonblocking) override
 
void close () override
 
- Public Member Functions inherited from Stream
virtual ~Stream () noexcept(false)
 
- Public Member Functions inherited from ReferenceCountedObject
 ReferenceCountedObject () noexcept
 
 ReferenceCountedObject (const ReferenceCountedObject &copy) noexcept
 
 ReferenceCountedObject (ReferenceCountedObject &&move) noexcept
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &copy) noexcept
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&move) noexcept
 
MemorySize getNumberOfReferences_INTERNAL () const noexcept
 
virtual bool useGarbageCollector () const noexcept
 
- Public Member Functions inherited from DynamicObject
 DynamicObject () noexcept
 
bool isValidObject () const noexcept
 
virtual ~DynamicObject () noexcept(false)
 
 _COM_AZURE_DEV__BASE__OVERRIDE_ALLOC ()
 

Detailed Description

Memory output stream.

Member Function Documentation

◆ close()

void MemoryOutputStream::close ( )
inlineoverridevirtual

Closes the stream and releases any system resources associated with the stream.

Implements Stream.

◆ flush()

void MemoryOutputStream::flush ( )
inlineoverridevirtual

Forces any buffered bytes to be written out.

Implements OutputStream.

◆ write()

unsigned int MemoryOutputStream::write ( const uint8 *  buffer,
unsigned int  size,
bool  nonblocking 
)
overridevirtual

Writes the specified number of bytes in the buffer to the stream. In blocking mode the method does not return until all bytes have been written. In non-blocking mode the total number of bytes written may be any number below or equal to the requested number of bytes.

Parameters
bufferThe buffer containing the bytes to be written.
sizeThe number of bytes to be written.
nonblockingSpecifies that the method may not block.
Returns
The actual number of bytes written to the stream.

Implements OutputStream.