C# Class Proto.Test.MyMessage

显示文件 Open project: hultqvist/protobuf Class Usage Examples

Public Methods

Method Description
Deserialize ( Stream stream ) : MyMessage

Helper: create a new instance to deserializing into

Deserialize ( byte buffer ) : MyMessage

Helper: put the buffer into a MemoryStream and create a new instance to deserializing into

Deserialize ( Stream stream, Proto instance ) : Proto.Test.MyMessage

Takes the remaining content of the stream and deserialze it into the instance.

Deserialize ( byte buffer, Proto instance ) : Proto.Test.MyMessage

Helper: put the buffer into a MemoryStream before deserializing

DeserializeLength ( Stream stream, int length ) : MyMessage

Helper: create a new instance to deserializing into

DeserializeLength ( Stream stream, int length, Proto instance ) : Proto.Test.MyMessage

Read the given number of bytes from the stream and deserialze it into the instance.

DeserializeLengthDelimited ( Stream stream ) : MyMessage

Helper: create a new instance to deserializing into

DeserializeLengthDelimited ( Stream stream, Proto instance ) : Proto.Test.MyMessage

Read the VarInt length prefix and the given number of bytes from the stream and deserialze it into the instance.

Serialize ( Stream stream, MyMessage instance ) : void

Serialize the instance into the stream

SerializeLengthDelimited ( Stream stream, MyMessage instance ) : void

Helper: Serialize with a varint length prefix

SerializeToBytes ( MyMessage instance ) : byte[]

Helper: Serialize into a MemoryStream and return its byte array

Method Details

Deserialize() public static method

Helper: create a new instance to deserializing into
public static Deserialize ( Stream stream ) : MyMessage
stream Stream
return MyMessage

Deserialize() public static method

Helper: put the buffer into a MemoryStream and create a new instance to deserializing into
public static Deserialize ( byte buffer ) : MyMessage
buffer byte
return MyMessage

Deserialize() public static method

Takes the remaining content of the stream and deserialze it into the instance.
public static Deserialize ( Stream stream, Proto instance ) : Proto.Test.MyMessage
stream Stream
instance Proto
return Proto.Test.MyMessage

Deserialize() public static method

Helper: put the buffer into a MemoryStream before deserializing
public static Deserialize ( byte buffer, Proto instance ) : Proto.Test.MyMessage
buffer byte
instance Proto
return Proto.Test.MyMessage

DeserializeLength() public static method

Helper: create a new instance to deserializing into
public static DeserializeLength ( Stream stream, int length ) : MyMessage
stream Stream
length int
return MyMessage

DeserializeLength() public static method

Read the given number of bytes from the stream and deserialze it into the instance.
public static DeserializeLength ( Stream stream, int length, Proto instance ) : Proto.Test.MyMessage
stream Stream
length int
instance Proto
return Proto.Test.MyMessage

DeserializeLengthDelimited() public static method

Helper: create a new instance to deserializing into
public static DeserializeLengthDelimited ( Stream stream ) : MyMessage
stream Stream
return MyMessage

DeserializeLengthDelimited() public static method

Read the VarInt length prefix and the given number of bytes from the stream and deserialze it into the instance.
public static DeserializeLengthDelimited ( Stream stream, Proto instance ) : Proto.Test.MyMessage
stream Stream
instance Proto
return Proto.Test.MyMessage

Serialize() public static method

Serialize the instance into the stream
public static Serialize ( Stream stream, MyMessage instance ) : void
stream Stream
instance MyMessage
return void

SerializeLengthDelimited() public static method

Helper: Serialize with a varint length prefix
public static SerializeLengthDelimited ( Stream stream, MyMessage instance ) : void
stream Stream
instance MyMessage
return void

SerializeToBytes() public static method

Helper: Serialize into a MemoryStream and return its byte array
public static SerializeToBytes ( MyMessage instance ) : byte[]
instance MyMessage
return byte[]