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

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

Inheritance diagram for catapult::io::BufferedInputFileStream:
Collaboration diagram for catapult::io::BufferedInputFileStream:

Public Member Functions

 BufferedInputFileStream (RawFile &&rawFile, size_t bufferSize=Default_Stream_Buffer_Size)
 Creates a buffered input stream around rawFile with an optional internal buffer size (bufferSize). 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
 

Private Attributes

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

Detailed Description

Provides a buffered input stream around raw file.

Constructor & Destructor Documentation

◆ BufferedInputFileStream()

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

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

Member Function Documentation

◆ eof()

bool catapult::io::BufferedInputFileStream::eof ( ) const
overridevirtual

Returns true if no data is left in the stream.

Implements catapult::io::InputStream.

Here is the call graph for this function:

◆ read()

void catapult::io::BufferedInputFileStream::read ( const MutableRawBuffer &  buffer)
overridevirtual

Reads data from this stream into buffer.

Exceptions
catapult_file_io_errorif requested amount of data could not be read.

Implements catapult::io::InputStream.

Here is the call graph for this function:

Member Data Documentation

◆ m_buffer

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

◆ m_bufferPosition

size_t catapult::io::BufferedInputFileStream::m_bufferPosition
private

◆ m_numBytesInBuffer

size_t catapult::io::BufferedInputFileStream::m_numBytesInBuffer
private

◆ m_rawFile

RawFile catapult::io::BufferedInputFileStream::m_rawFile
private

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