3#ifndef PDFSDK_CXX_PDF_READ_STREAM_H_INCLUDED_
4#define PDFSDK_CXX_PDF_READ_STREAM_H_INCLUDED_
8#include "wrapper_base.h"
15class ReadStream :
public detail::RefCountedHandle<PDReadStream> {
23 size_t Read(
void* buffer,
size_t nbytes);
37 static constexpr size_t BUFFER_SIZE = 4096;
38 char buffer[BUFFER_SIZE];
39 size_t nread =
Read(buffer, BUFFER_SIZE);
41 data.append(buffer, nread);
42 nread =
Read(buffer, BUFFER_SIZE);
52 PDF_CXX_CORE_WRAPPER_DEFINE_MEMBERS_(
ReadStream, PDReadStream)
57#include "read_stream_impl.inl"
Represents a read stream for reading data.
Definition read_stream.h:15
std::string ReadAll()
Reads all data from the stream and returns it as a string.
Definition read_stream.h:35
size_t Read(void *buffer, size_t nbytes)
Reads data from the stream into the specified buffer.
void Close()
Closes the read stream.