FileSerializer.DeserializeWithLengthPrefix<T> Method
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
TThe 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.
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.