CatapultServer  v0.5.0.1 (Elephant)
catapult::extensions::MemoryStream Class Reference

Memory-based implementation of input and output stream. More...

Inheritance diagram for catapult::extensions::MemoryStream:
Collaboration diagram for catapult::extensions::MemoryStream:

Public Member Functions

 MemoryStream (std::vector< uint8_t > &buffer)
 Creates a memory stream around buffer. More...
 
void write (const RawBuffer &buffer) override
 
void flush () override
 
- Public Member Functions inherited from catapult::io::BufferInputStreamAdapter< std::vector< uint8_t > >
 BufferInputStreamAdapter (const std::vector< uint8_t > &input)
 Creates an input stream around input. More...
 
size_t position () const
 Returns read position. More...
 
bool eof () const override
 Returns true if no data is left in the stream. More...
 
void read (const MutableRawBuffer &buffer) override
 
- Public Member Functions inherited from catapult::io::InputStream
virtual ~InputStream ()=default
 
- Public Member Functions inherited from catapult::io::OutputStream
virtual ~OutputStream ()=default
 

Private Attributes

std::vector< uint8_t > & m_buffer
 

Detailed Description

Memory-based implementation of input and output stream.

Constructor & Destructor Documentation

◆ MemoryStream()

catapult::extensions::MemoryStream::MemoryStream ( std::vector< uint8_t > &  buffer)
explicit

Creates a memory stream around buffer.

Member Function Documentation

◆ flush()

void catapult::extensions::MemoryStream::flush ( )
overridevirtual

Commits all pending data.

Exceptions
catapult_file_io_errorif flush failed.

Implements catapult::io::OutputStream.

◆ write()

void catapult::extensions::MemoryStream::write ( const RawBuffer &  buffer)
overridevirtual

Writes data pointed to by buffer to this stream.

Exceptions
catapult_file_io_errorif proper amount of data could not be written.

Implements catapult::io::OutputStream.

Member Data Documentation

◆ m_buffer

std::vector<uint8_t>& catapult::extensions::MemoryStream::m_buffer
private

The documentation for this class was generated from the following files: