PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
io_stream.h
1// Copyright (c) 2009-2025 Avanquest Software. All rights reserved.
2
3#ifndef PDFSDK_CXX_PDF_IO_STREAM_H_INCLUDED_
4#define PDFSDK_CXX_PDF_IO_STREAM_H_INCLUDED_
5
6#include <cstddef>
7#include <cstdint>
8
9#include <pdfsdk/cxx/bytes.h>
10
11namespace PDF {
12
20public:
21 virtual ~IDataSource() = default;
22
29 virtual size_t ReadAt(int64_t pos, std::span<Byte> buffer) = 0;
30
35 virtual int64_t GetSize() = 0;
36};
37
44public:
45 virtual ~IWriteSink() = default;
46
52 virtual size_t Write(std::span<const Byte> buffer) = 0;
53};
54
55} // namespace PDF
56
57#endif // PDFSDK_CXX_PDF_IO_STREAM_H_INCLUDED_
A callback interface for supplying bytes from a random-access source.
Definition io_stream.h:19
virtual size_t ReadAt(int64_t pos, std::span< Byte > buffer)=0
Reads bytes at an absolute position.
virtual int64_t GetSize()=0
Returns the total size of the source in bytes.
A callback interface for receiving bytes written sequentially.
Definition io_stream.h:43
virtual size_t Write(std::span< const Byte > buffer)=0
Writes bytes to the sink.