FileSerializer.SerializeWithLengthPrefix<T> Method

Writes a protocol-buffer representation of the given object to the supplied stream with a length-prefix.
Protected Sub SerializeWithLengthPrefix(Of  _ 
T)( _ 
ByVal stream As Stream, _ 
ByVal obj As T _ 
)
This language is not supported or no code example is available.
protected void SerializeWithLengthPrefix<T>( 
Stream stream
T obj 
)
This language is not supported or no code example is available.

Type Parameters

T

Parameters

stream
Stream

The file stream.

obj
T

The object to be serialized.

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.5, 4.6, 4.7

In this article

Definition