C# Class Griffin.Net.Protocols.MicroMsg.MicroMessageDecoder

Decode messages encoded with MicroMessageEncoder.

As MicroMessageEncoder can out-of-the-box send Stream-drived classes and byte[] arrays this class has to handle that too.

Streams will always be either MemoryStream or FileStream depending of the content-length. Same things goes for messages which are sent as byte[] arrays. They will also be received as streams.

Inheritance: IMessageDecoder
Exibir arquivo Open project: jgauffin/Griffin.Framework Class Usage Examples

Public Methods

Method Description
Clear ( ) : void

Reset the decoder so that we can parse a new message

MicroMessageDecoder ( IMessageSerializer serializer ) : System

Initializes a new instance of the MicroMessageDecoder class.

ProcessReadBytes ( ISocketBuffer buffer ) : void

Process bytes that we've received on the socket.

Private Methods

Method Description
CopyBytes ( ISocketBuffer e ) : bool
ProcessContent ( ISocketBuffer arg ) : bool
ProcessFixedHeader ( ISocketBuffer e ) : bool
ReadHeaderLength ( ISocketBuffer e ) : bool

Method Details

Clear() public method

Reset the decoder so that we can parse a new message
public Clear ( ) : void
return void

MicroMessageDecoder() public method

Initializes a new instance of the MicroMessageDecoder class.
serializer
public MicroMessageDecoder ( IMessageSerializer serializer ) : System
serializer IMessageSerializer The serializer used to decode the message that is being transported with MicroMsg.
return System

ProcessReadBytes() public method

Process bytes that we've received on the socket.
public ProcessReadBytes ( ISocketBuffer buffer ) : void
buffer ISocketBuffer Buffer to process.
return void