C# Class Lawo.EmberPlusSharp.S101.MessageDecodingStream

Transparently decodes a single S101 message.

At construction, a Message object is first decoded from the ReadBuffer object passed to CreateAsync and made available through the Message property. Afterwards, a call to any of the Read methods of this stream removes data from ReadBuffer object passed to the CreateAsync. The data is then decoded and the decoded form is then returned.

If a message contains multiple packets, their payload is automatically joined such that it can be read through this stream as if the message consisted of only one packet.

Inheritance: NonSeekableStream
Mostra file Open project: Lawo/ember-plus-sharp Class Usage Examples

Private Properties

Property Type Description
CreateAsync Task
MessageDecodingStream System
ReadDeframedAsync Task
ReadFromCurrentPacketAsync Task
ValidateMessage void

Public Methods

Method Description
DisposeAsync ( CancellationToken cancellationToken ) : Task
ReadAsync ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : Task

Private Methods

Method Description
CreateAsync ( ReadBuffer rawBuffer, byte discardBuffer, Action outOfFrameByteReceived, CancellationToken cancellationToken ) : Task
MessageDecodingStream ( ReadBuffer rawBuffer, byte discardBuffer, Action outOfFrameByteReceived ) : System
ReadDeframedAsync ( byte buffer, int index, int count, CancellationToken cancellationToken ) : Task
ReadFromCurrentPacketAsync ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : Task
ValidateMessage ( S101Message newMessage ) : void

Method Details

DisposeAsync() public final method

public final DisposeAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
return Task

ReadAsync() public final method

public final ReadAsync ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : Task
buffer byte
offset int
count int
cancellationToken System.Threading.CancellationToken
return Task