Click or drag to resize
UnpackingUnpackCharStream Method (Stream, Encoding)
Unpacks raw value from the specified Stream as UnpackingStreamReader with specified encoding.

Namespace: MsgPack
Assembly: MsgPack (in MsgPack.dll) Version: 0.6.0
Syntax
public static UnpackingStreamReader UnpackCharStream(
	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: UnpackingStreamReader
The UnpackingStreamReader which represents raw value stream as UTF-8 string.
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. Note that the state of source will be unpredictable espicially it is not seekable.
Remarks

if source contains invalid sequence as specified encoding string, the DecoderFallbackException may occurs on read char.

UnpackingStreamReader does not own source, so source still should be closed.

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

See Also