FileSerializer.DeserializeWithLengthPrefix<T> Method

Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed data.
Protected Function DeserializeWithLengthPrefix(Of  _ 
T)( _ 
ByVal stream As Stream, _ 
ByRef bytesRead As Long, _ 
ByRef haveObject As Boolean, _ 
Optional ByVal expectedField As Integer = 1 _ 
) As T
This language is not supported or no code example is available.
protected T DeserializeWithLengthPrefix<T>( 
Stream stream
out long bytesRead
out bool haveObject
int expectedField = 1 
)
This language is not supported or no code example is available.

Type Parameters

T

Parameters

stream
Stream

The binary stream to apply to the instance (cannot be null/Nothing)

bytesRead
long

Returns the number of bytes consumed by this operation (includes length-prefix overheads and any skipped data).

haveObject
bool

True when an object has been read, otherwise false.

expectedField
int

The tag used as a prefix to each record.

Return Value

T

The updated instance; this may be different to the instance argument if either the original instance was null, or the stream defines a known sub-type of the original instance.

Remarks
 
You can use this method to read an object from a protocol-buffer stream representation. You had to serialize the file header before using this method 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