Open CASCADE Technology  7.7.0
Public Member Functions
Standard_ReadBuffer Class Reference

Auxiliary tool for buffered reading from input stream within chunks of constant size. More...

#include <Standard_ReadBuffer.hxx>

Public Member Functions

 Standard_ReadBuffer (int64_t theDataLen, size_t theChunkLen, bool theIsPartialPayload=false)
 Constructor with initialization. More...
 
void Init (int64_t theDataLen, size_t theChunkLen, bool theIsPartialPayload=false)
 Initialize the buffer. More...
 
bool IsDone () const
 Return TRUE if amount of read bytes is equal to requested length of entire data. More...
 
template<typename Chunk_T , typename Stream_T >
Chunk_T * ReadChunk (Stream_T &theStream)
 Read next chunk. More...
 
template<typename Stream_T >
char * ReadDataChunk (Stream_T &theStream)
 Read next chunk. More...
 

Detailed Description

Auxiliary tool for buffered reading from input stream within chunks of constant size.

Constructor & Destructor Documentation

◆ Standard_ReadBuffer()

Standard_ReadBuffer::Standard_ReadBuffer ( int64_t  theDataLen,
size_t  theChunkLen,
bool  theIsPartialPayload = false 
)
inline

Constructor with initialization.

Member Function Documentation

◆ Init()

void Standard_ReadBuffer::Init ( int64_t  theDataLen,
size_t  theChunkLen,
bool  theIsPartialPayload = false 
)
inline

Initialize the buffer.

Parameters
theDataLen[in] the full length of input data to read from stream.
theChunkLen[in] the length of single chunk to read
theIsPartialPayload[in] when FALSE, theDataLen will be automatically aligned to the multiple of theChunkLen; when TRUE, last chunk will be read from stream exactly till theDataLen allowing portion of chunk to be uninitialized (useful for interleaved data)

◆ IsDone()

bool Standard_ReadBuffer::IsDone ( ) const
inline

Return TRUE if amount of read bytes is equal to requested length of entire data.

◆ ReadChunk()

template<typename Chunk_T , typename Stream_T >
Chunk_T* Standard_ReadBuffer::ReadChunk ( Stream_T &  theStream)
inline

Read next chunk.

Returns
pointer to the chunk or NULL on error / end of reading buffer

◆ ReadDataChunk()

template<typename Stream_T >
char* Standard_ReadBuffer::ReadDataChunk ( Stream_T &  theStream)
inline

Read next chunk.

Returns
pointer to the chunk or NULL on error / end of reading buffer

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