C# Класс Kafka.Client.Message

Message for Kafka.
A message. The format of an N byte message is the following: 1 byte "magic" identifier to allow format changes 4 byte CRC32 of the payload N - 5 byte payload
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetBytes ( ) : byte[]

Converts the message to bytes in the format Kafka likes.

IsValid ( ) : bool

Determines if the message is valid given the payload and its checksum.

Message ( byte payload ) : System

Initializes a new instance of the Message class.

Uses the DefaultMagicIdentifier as a default.

Message ( byte payload, byte magic ) : System

Initializes a new instance of the Message class.

Initializes the checksum as null. It will be automatically computed.

Message ( byte payload, byte magic, byte checksum ) : System

Initializes a new instance of the Message class.

ParseFrom ( byte data ) : Message

Parses a message from a byte array given the format Kafka likes.

ToString ( ) : string

Try to show the payload as decoded to UTF-8.

Приватные методы

Метод Описание
CalculateChecksum ( ) : byte[]

Calculates the CRC32 checksum on the payload of the message.

Описание методов

GetBytes() публичный Метод

Converts the message to bytes in the format Kafka likes.
public GetBytes ( ) : byte[]
Результат byte[]

IsValid() публичный Метод

Determines if the message is valid given the payload and its checksum.
public IsValid ( ) : bool
Результат bool

Message() публичный Метод

Initializes a new instance of the Message class.
Uses the DefaultMagicIdentifier as a default.
public Message ( byte payload ) : System
payload byte The data for the payload.
Результат System

Message() публичный Метод

Initializes a new instance of the Message class.
Initializes the checksum as null. It will be automatically computed.
public Message ( byte payload, byte magic ) : System
payload byte The data for the payload.
magic byte The magic identifier.
Результат System

Message() публичный Метод

Initializes a new instance of the Message class.
public Message ( byte payload, byte magic, byte checksum ) : System
payload byte The data for the payload.
magic byte The magic identifier.
checksum byte The checksum for the payload.
Результат System

ParseFrom() публичный статический Метод

Parses a message from a byte array given the format Kafka likes.
public static ParseFrom ( byte data ) : Message
data byte The data for a message.
Результат Message

ToString() публичный Метод

Try to show the payload as decoded to UTF-8.
public ToString ( ) : string
Результат string