New to Telerik Document ProcessingStart a free 30-day trial

Base for binary format providers that import/export documents from/to byte arrays and streams.

Definition

Constructors

C#
protected BinaryFormatProviderBase()

Methods

Exports the document to a byte array with an optional timeout.

C#
public byte[] Export(T document, TimeSpan? timeout)
Parameters:documentT

The document.

timeoutTimeSpan?

The timeout after which the operation will be cancelled.

Returns:

byte[]

Exceptions:

ArgumentOutOfRangeException

The exception that is thrown when timeout is less than -1 or greater than Int32.MaxValue. Note that this upper bound is more restrictive than TimeSpan.MaxValue.

Implements: IBinaryFormatProvider<T>.Export(T, TimeSpan?)

Imports a document from a byte array with an optional timeout and returns the parsed document.

C#
[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
public T Import(byte[] input, TimeSpan? timeout)
Parameters:inputbyte[]

The input.

timeoutTimeSpan?

The timeout after which the operation will be cancelled.

Returns:

T

The document.

Exceptions:

ArgumentOutOfRangeException

The exception that is thrown when timeout is less than -1 or greater than Int32.MaxValue. Note that this upper bound is more restrictive than TimeSpan.MaxValue.

Implements: IBinaryFormatProvider<T>.Import(byte[], TimeSpan?)