FileSerializer.SerializeWithLengthPrefix Method

Writes a protocol-buffer representation of the given object to the supplied stream with a length-prefix.
Protected Sub SerializeWithLengthPrefix( _ 
ByVal stream As Stream, _ 
ByVal obj As Object, _ 
Optional ByVal fieldNumber As Integer = 1 _ 
)
This language is not supported or no code example is available.
protected void SerializeWithLengthPrefix( 
Stream stream
object obj
int fieldNumber = 1 
)
This language is not supported or no code example is available.

Parameters

stream
Stream

The file stream.

obj
object

The object to be serialized.

fieldNumber
int

The tag used as a prefix to each record.

Remarks
 
You can use this method to write an object as protocol-buffer representation. You had to store the FileHeader somewhere to guarantee the backward compatibility when reading. The opening and the closing of the stream is delegated to you.

.NET Framework

Supported in: 4.8

In this article

Definition