ClassBinaryFormatProviderBase<T>
Base for binary format providers that import/export documents from/to byte arrays and streams.
Definition
Namespace:Telerik.Windows.Documents.Common.FormatProviders
Assembly:Telerik.Windows.Documents.Core.dll
Type Parameters:
T
The type of the document.
Syntax:
public abstract class BinaryFormatProviderBase<T> : FormatProviderBase<T>, IFormatProvider<T>, IBinaryFormatProvider<T>
Inheritance: objectFormatProviderBase<T>BinaryFormatProviderBase<T>
Derived Classes:
Implements:
Inherited Members
Constructors
BinaryFormatProviderBase()
Declaration
protected BinaryFormatProviderBase()
Methods
Export(T)
Exports the document to a byte array representation.
Declaration
[Obsolete("This method is obsolete. Please use Export(T document, TimeSpan? timeout) instead.")]
public byte[] Export(T document)
Parameters
document
T
The document.
Returns
byte[]
The result byte array.
Implements
Export(T, TimeSpan?)
Exports the document to a byte array with an optional timeout.
Declaration
public byte[] Export(T document, TimeSpan? timeout)
Parameters
document
T
The document.
timeout
The timeout after which the operation will be cancelled.
Returns
byte[]
Exceptions
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
Import(byte[])
Imports a document from a byte array and returns the parsed document instance.
Declaration
[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
[Obsolete("This method is obsolete. Please use Import(byte[] input, TimeSpan? timeout) instead.")]
public T Import(byte[] input)
Parameters
input
byte[]
The input.
Returns
T
The document.
Implements
Import(byte[], TimeSpan?)
Imports a document from a byte array with an optional timeout and returns the parsed document.
Declaration
[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
public T Import(byte[] input, TimeSpan? timeout)
Parameters
input
byte[]
The input.
timeout
The timeout after which the operation will be cancelled.
Returns
T
The document.
Exceptions
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