libCZI
Reading and Writing CZI documents made easy
Loading...
Searching...
No Matches
libCZI::IStream Class Referenceabstract

#include <libCZI.h>

Inheritance diagram for libCZI::IStream:
libCZI::IInputOutputStream

Public Member Functions

virtual void Read (std::uint64_t offset, void *pv, std::uint64_t size, std::uint64_t *ptrBytesRead)=0
 

Detailed Description

Interface used for accessing the data-stream.
Implementations of this interface are expected to be thread-safe - it should be possible to call the Read-method from multiple threads simultaneously. In libCZI-usage, exceptions thrown by Read-method are wrapped into a libCZI::LibCZIIOException-exception, where the exception thrown by the Read-method is stored as the inner exception.

Member Function Documentation

◆ Read()

virtual void libCZI::IStream::Read ( std::uint64_t  offset,
void *  pv,
std::uint64_t  size,
std::uint64_t *  ptrBytesRead 
)
pure virtual

Reads the specified amount of data from the stream at the specified position. This method is expected to throw an exception for any kind of I/O-related error. It must not throw an exception if reading past the end of a file - instead, it must return the number of bytes actually read accordingly. For the special case of size==0, the behavior should be as follows: the method should operate as for a size>0, but it should not read any data. The method should return 0 in ptrBytesRead.

Parameters
offsetThe offset to start reading from.
[out]pvThe caller-provided buffer for the data. Must be non-null.
sizeThe size of the buffer.
[out]ptrBytesReadIf non-null, the variable pointed to will receive the number of bytes actually read.

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