CatapultServer  v0.5.0.1 (Elephant)
catapult::io::BufferedOutputFileStream Class Referencefinal

Provides a buffered output stream around raw file. More...

Inheritance diagram for catapult::io::BufferedOutputFileStream:
Collaboration diagram for catapult::io::BufferedOutputFileStream:

Public Member Functions

 BufferedOutputFileStream (RawFile &&rawFile, size_t bufferSize=Default_Stream_Buffer_Size)
 Creates a buffered output stream around rawFile with an optional internal buffer size (bufferSize). More...
 
void write (const RawBuffer &buffer) override
 
void flush () override
 
- Public Member Functions inherited from catapult::io::OutputStream
virtual ~OutputStream ()=default
 

Private Attributes

RawFile m_rawFile
 
std::vector< uint8_t > m_buffer
 
size_t m_bufferPosition
 

Detailed Description

Provides a buffered output stream around raw file.

Constructor & Destructor Documentation

◆ BufferedOutputFileStream()

catapult::io::BufferedOutputFileStream::BufferedOutputFileStream ( RawFile &&  rawFile,
size_t  bufferSize = Default_Stream_Buffer_Size 
)

Creates a buffered output stream around rawFile with an optional internal buffer size (bufferSize).

Member Function Documentation

◆ flush()

void catapult::io::BufferedOutputFileStream::flush ( )
overridevirtual

Commits all pending data.

Exceptions
catapult_file_io_errorif flush failed.

Implements catapult::io::OutputStream.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write()

void catapult::io::BufferedOutputFileStream::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.

Here is the call graph for this function:

Member Data Documentation

◆ m_buffer

std::vector<uint8_t> catapult::io::BufferedOutputFileStream::m_buffer
private

◆ m_bufferPosition

size_t catapult::io::BufferedOutputFileStream::m_bufferPosition
private

◆ m_rawFile

RawFile catapult::io::BufferedOutputFileStream::m_rawFile
private

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