Interface IDataProvider
This interface is to be used by all possible data providers for Document access.
Namespace: PSPDFKitFoundation.Data
Assembly: PSPDFKitFoundation.dll
Syntax
public interface IDataProvider
Properties
Size
Returns the size of the data.
Declaration
ulong Size { get; }
Property Value
Type | Description |
---|---|
System. |
SupportsWriting
Specifies whether a write can be attempted using Replace
Declaration
bool SupportsWriting { get; }
Property Value
Type | Description |
---|---|
System. |
Uid
Returns a Uid that enables you to uniquely identify this data provider.
The Uid for the same provider might change between application restarts.
For persisting it, you must either implement your own mechanism, or use the Random
Declaration
string Uid { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
CreateDataSink(DataSinkOption)
This method creates a data sink for your data provider with the given Data
Declaration
IDataSink CreateDataSink(DataSinkOption option)
Parameters
Type | Name | Description |
---|---|---|
Data |
option | The desired options for the DataSink. |
Returns
Type | Description |
---|---|
IData |
ReadAsync(UInt32, UInt32)
Reads and returns data read from offset with size. You have to make sure not to read past the end of your data.
Declaration
IAsyncOperation<IBuffer> ReadAsync(uint size, uint offset)
Parameters
Type | Name | Description |
---|---|---|
System. |
size | The requested amount of data to read. |
System. |
offset | The offset into the data source to start reading from. |
Returns
Type | Description |
---|---|
Windows. |
ReplaceWithDataSinkAsync(IDataSink)
This method should replace your current data with the one written into the data sink.
To create a data sink, see Create
Depending on the Data
Declaration
IAsyncOperation<bool> ReplaceWithDataSinkAsync(IDataSink dataSink)
Parameters
Type | Name | Description |
---|---|---|
IData |
dataSink | The object instantiated with Create |
Returns
Type | Description |
---|---|
Windows. |