TnefReaderReadValueAsBytesAsync Method

Asynchronously read the current attribute's raw value.

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.

Remarks

Asynchronously reads the current attribute's raw value.

The value 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 array is returned. Use OpenValueStream to read large values.

Exceptions

ObjectDisposedException The reader has been disposed.
InvalidOperationException

The reader is not positioned on an attribute.

-or-

The attribute's value has already been read.

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

See Also