Click or drag to resize
UnpackingUnpackString Method (Stream, Encoding)
Unpacks String value from the specified Stream with specified encoding.

Namespace: MsgPack
Assembly: MsgPack (in MsgPack.dll) Version: 0.6.0
Syntax
public static string UnpackString(
	Stream source,
	Encoding encoding
)

Parameters

source
Type: System.IOStream
The Stream which contains Message Pack binary stream.
encoding
Type: System.TextEncoding
The Encoding to decode binary stream.

Return Value

Type: String
The unpacked String value.
Exceptions
ExceptionCondition
ArgumentNullExceptionsource is null. Or encoding is null.
ArgumentException The CanRead of source is false.
UnpackExceptionsource is not valid MessagePack stream. Note that the state of source will be unpredictable espicially it is not seekable.
MessageTypeException The unpacked result in the source is not raw binary. Or, the unpacked result in the source is invalid as specified encoding byte stream. Note that the state of source will be unpredictable espicially it is not seekable.
Remarks

The processed bytes count can be calculated via Position of source when the CanSeek is true.

When the type of packed value is not known, use UnpackObject(Stream) instead.

See Also