byteme
Read/write bytes from various sources
Loading...
Searching...
No Matches
byteme::ZlibBufferReader Class Referencefinal

Read and decompress bytes from a Zlib-compressed buffer. More...

#include <ZlibBufferReader.hpp>

Inheritance diagram for byteme::ZlibBufferReader:
Collaboration diagram for byteme::ZlibBufferReader:

Public Member Functions

 ZlibBufferReader (const unsigned char *buffer, std::size_t length, const ZlibBufferReaderOptions &options)
 
std::size_t read (unsigned char *buffer, std::size_t n)
 
- Public Member Functions inherited from byteme::Reader

Detailed Description

Read and decompress bytes from a Zlib-compressed buffer.

This is basically a wrapper around Zlib's inflate method, with correct closing and error checking.

Constructor & Destructor Documentation

◆ ZlibBufferReader()

byteme::ZlibBufferReader::ZlibBufferReader ( const unsigned char * buffer,
std::size_t length,
const ZlibBufferReaderOptions & options )
inline
Parameters
bufferPointer to an array containing the compressed data.
lengthLength of the buffer array.
optionsFurther options.

Member Function Documentation

◆ read()

std::size_t byteme::ZlibBufferReader::read ( unsigned char * buffer,
std::size_t n )
inlinevirtual

Read the specified number of bytes from the source into a user-supplied buffer.

Parameters
[out]bufferPointer to an array of at least length n.
nMaximum number of bytes to extract from the source. This may be zero.
Returns
Number of bytes that were actually extracted from the source. This will be less than or equal to n. If less than n, the stream of bytes from the source is finished and no more calls to read() should be performed.

Implements byteme::Reader.


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