UnpackingUnpackCharStream Method (Stream, Encoding) |
Namespace: MsgPack
public static UnpackingStreamReader UnpackCharStream( Stream source, Encoding encoding )
Exception | Condition |
---|---|
ArgumentNullException | source is null. Or, encoding is null. |
ArgumentException | The CanRead of source is false. |
UnpackException | source 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. |
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.