TnefPropertyReaderReadValueAsBytesAsync Method

Asynchronously read the current value as a byte array.

Definition

Namespace: MimeKit.Tnef
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public Task<byte[]> ReadValueAsBytesAsync(
	CancellationToken cancellationToken = default
)

Parameters

cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskByte
The value as a byte array.

Remarks

Reads any string, binary, object or ClassId value as a byte array.

Variable-length values may only be read once.

If the value is larger than MaxPropertyValueLength or the remaining MaxTotalDataBytes allow, a DataSizeLimitExceeded issue is reported and an empty value is returned.

Exceptions

ObjectDisposedException The TnefReader has been disposed.
InvalidOperationException

The TnefReader has been advanced to another attribute.

-or-

The reader is not positioned on a value.

-or-

The value cannot be read as a byte array.

-or-

The value has already been read.

OperationCanceledException The operation was canceled via the cancellation token.
IOException An I/O error occurred.

See Also