C# 클래스 Brod.Messages.Message

파일 보기 프로젝트 열기: paralect/brod 1 사용 예제들

공개 메소드들

메소드 설명
CalculateMessageLength ( Int32 payloadLength ) : Int32

Calculate message length based on payload length

CalculateOnDiskMessageLength ( Int32 payloadLength ) : Int32

Calculate "on-disk" message length based on payload length. It differ from CalculateMessageLengh by additional 4 bytes that occupied by message lengh Int32 value

CalculatePayloadLength ( Int32 messageLength ) : Int32

Calculate payload length based on message length

CreateMessage ( byte payload ) : Message

Factory method for creating message with payload

Validate ( ) : void

Validate message by computing CRC32 hash for payload and comparing with Crc property. Throws exception if validation fails.

비공개 메소드들

메소드 설명
ByteArraysEqual ( byte b1, byte b2 ) : bool

Trivial, yet efficient, byte array comparison

메소드 상세

CalculateMessageLength() 공개 정적인 메소드

Calculate message length based on payload length
public static CalculateMessageLength ( Int32 payloadLength ) : Int32
payloadLength System.Int32
리턴 System.Int32

CalculateOnDiskMessageLength() 공개 정적인 메소드

Calculate "on-disk" message length based on payload length. It differ from CalculateMessageLengh by additional 4 bytes that occupied by message lengh Int32 value
public static CalculateOnDiskMessageLength ( Int32 payloadLength ) : Int32
payloadLength System.Int32
리턴 System.Int32

CalculatePayloadLength() 공개 정적인 메소드

Calculate payload length based on message length
public static CalculatePayloadLength ( Int32 messageLength ) : Int32
messageLength System.Int32
리턴 System.Int32

CreateMessage() 공개 정적인 메소드

Factory method for creating message with payload
public static CreateMessage ( byte payload ) : Message
payload byte
리턴 Message

Validate() 공개 메소드

Validate message by computing CRC32 hash for payload and comparing with Crc property. Throws exception if validation fails.
public Validate ( ) : void
리턴 void