Class FileDataProvider

A data provider to supply a file path to PSPDFKit. The standard operations of reading and writing are ignored in favor of passing the path to lower level functions. The file will be opened with FileAccess Read/Write and FileShare Read/Write. For more inforation please see the .NET documentation. https://docs.microsoft.com/en-us/dotnet/api/system.io.fileshare?view=netstandard-2.0 https://docs.microsoft.com/en-us/dotnet/api/system.io.fileaccess?view=netstandard-2.0

Inheritance
System.Object
FileDataProvider
Implements
Namespace: PSPDFKit.Providers
Assembly: PSPDFKit.dll
Syntax
public sealed class FileDataProvider : object, IWritableDataProvider, IDataProvider

Constructors

FileDataProvider(String)

Constructs a IWritableDataProvider to pass to PSPDFKit.

Declaration
public FileDataProvider(string path)
Parameters
Type Name Description
System.String path

The path to open.

Properties

Path

The path which the FileDataProvider is holding.

Declaration
public string Path { get; }
Property Value
Type Description
System.String

Methods

Finish()

Declaration
public bool Finish()
Returns
Type Description
System.Boolean

GetSize()

Declaration
public long GetSize()
Returns
Type Description
System.Int64

GetUid()

Declaration
public string GetUid()
Returns
Type Description
System.String

Read(Int64, Int64)

Declaration
public IEnumerable<byte> Read(long size, long offset)
Parameters
Type Name Description
System.Int64 size
System.Int64 offset
Returns
Type Description
IEnumerable<System.Byte>

StartWrite(DataSinkOption)

Declaration
public bool StartWrite(DataSinkOption dataSinkOption)
Parameters
Type Name Description
DataSinkOption dataSinkOption
Returns
Type Description
System.Boolean

Write(Byte[])

Declaration
public bool Write(byte[] data)
Parameters
Type Name Description
System.Byte[] data
Returns
Type Description
System.Boolean

Implements

IWritableDataProvider
IDataProvider