Inherits IEnumerable< MessagePackObject >, and IDisposable.

Inherited by MsgPack.ByteArrayUnpacker, MsgPack.MessagePackStreamUnpacker, and MsgPack.SubtreeUnpacker.

Public Member Functions

void Dispose ()
 Releases all managed resources. More...
 
virtual void Drain ()
 Drains remaining items in current context. More...
 
Unpacker ReadSubtree ()
 Starts unpacking of current subtree. More...
 
bool Read ()
 Reads next Message Pack entry. More...
 
IEnumerator< MessagePackObjectGetEnumerator ()
 Gets IEnumerator<T> to enumerate MessagePackObject from source stream. More...
 
long? Skip ()
 Skips the subtree where the root is the current entry, and returns skipped byte length. More...
 
MessagePackObjectReadItem ()
 Gets a current item or collection as single MessagePackObject from the stream. More...
 
MessagePackObject ReadItemData ()
 Gets a current item or collection as single MessagePackObject from the stream. More...
 
MessagePackObjectUnpackSubtree ()
 Unpacks current subtree and returns subtree root as array or map. More...
 
MessagePackObject UnpackSubtreeData ()
 Unpacks current subtree and returns subtree root as array or map. More...
 
virtual bool ReadBoolean (out Boolean result)
 Reads next Boolean value from current stream. More...
 
virtual bool ReadNullableBoolean (out Boolean? result)
 Reads next nullable Boolean value from current stream. More...
 
virtual bool ReadByte (out Byte result)
 Reads next Byte value from current stream. More...
 
virtual bool ReadNullableByte (out Byte? result)
 Reads next nullable Byte value from current stream. More...
 
virtual bool ReadSByte (out SByte result)
 Reads next SByte value from current stream. More...
 
virtual bool ReadNullableSByte (out SByte? result)
 Reads next nullable SByte value from current stream. More...
 
virtual bool ReadInt16 (out Int16 result)
 Reads next Int16 value from current stream. More...
 
virtual bool ReadNullableInt16 (out Int16? result)
 Reads next nullable Int16 value from current stream. More...
 
virtual bool ReadUInt16 (out UInt16 result)
 Reads next UInt16 value from current stream. More...
 
virtual bool ReadNullableUInt16 (out UInt16? result)
 Reads next nullable UInt16 value from current stream. More...
 
virtual bool ReadInt32 (out Int32 result)
 Reads next Int32 value from current stream. More...
 
virtual bool ReadNullableInt32 (out Int32? result)
 Reads next nullable Int32 value from current stream. More...
 
virtual bool ReadUInt32 (out UInt32 result)
 Reads next UInt32 value from current stream. More...
 
virtual bool ReadNullableUInt32 (out UInt32? result)
 Reads next nullable UInt32 value from current stream. More...
 
virtual bool ReadInt64 (out Int64 result)
 Reads next Int64 value from current stream. More...
 
virtual bool ReadNullableInt64 (out Int64? result)
 Reads next nullable Int64 value from current stream. More...
 
virtual bool ReadUInt64 (out UInt64 result)
 Reads next UInt64 value from current stream. More...
 
virtual bool ReadNullableUInt64 (out UInt64? result)
 Reads next nullable UInt64 value from current stream. More...
 
virtual bool ReadSingle (out Single result)
 Reads next Single value from current stream. More...
 
virtual bool ReadNullableSingle (out Single? result)
 Reads next nullable Single value from current stream. More...
 
virtual bool ReadDouble (out Double result)
 Reads next Double value from current stream. More...
 
virtual bool ReadNullableDouble (out Double? result)
 Reads next nullable Double value from current stream. More...
 
virtual bool ReadMessagePackExtendedTypeObject (out MessagePackExtendedTypeObject result)
 Reads next MessagePackExtendedTypeObject value from current stream. More...
 
virtual bool ReadNullableMessagePackExtendedTypeObject (out MessagePackExtendedTypeObject? result)
 Reads next nullable MessagePackExtendedTypeObject value from current stream. More...
 
virtual bool ReadArrayLength (out long result)
 Reads next array length value from current stream. More...
 
virtual bool ReadMapLength (out long result)
 Reads next map length value from current stream. More...
 
virtual bool ReadBinary (out byte[] result)
 Reads next byte array value from current stream. More...
 
virtual bool ReadString (out string result)
 Reads next utf-8 encoded string value from current stream. More...
 
virtual bool ReadObject (out MessagePackObject result)
 Reads next value from current stream. More...
 

Static Public Member Functions

static Unpacker Create (Stream stream)
 Creates the new Unpacker from specified stream. More...
 
static Unpacker Create (Stream stream, bool ownsStream)
 Creates the new Unpacker from specified stream. More...
 
static Unpacker Create (Stream stream, PackerUnpackerStreamOptions streamOptions)
 Creates the new Unpacker from specified stream. More...
 
static Unpacker Create (Stream stream, PackerUnpackerStreamOptions streamOptions, UnpackerOptions unpackerOptions)
 Creates the new Unpacker from specified stream. More...
 
static ByteArrayUnpacker Create (byte[] source)
 Creates a new ByteArrayUnpacker from specified byte array. More...
 
static ByteArrayUnpacker Create (byte[] source, int startOffset)
 Creates a new ByteArrayUnpacker from specified byte array. More...
 
static ByteArrayUnpacker Create (byte[] source, UnpackerOptions unpackerOptions)
 Creates a new ByteArrayUnpacker from specified byte array. More...
 
static ByteArrayUnpacker Create (byte[] source, int startOffset, UnpackerOptions unpackerOptions)
 Creates a new ByteArrayUnpacker from specified byte array. More...
 

Protected Member Functions

 Unpacker ()
 Initializes a new instance of the Unpacker class. More...
 
virtual void Dispose (bool disposing)
 Releases unmanaged and optionally managed resources. More...
 
abstract Unpacker ReadSubtreeCore ()
 Starts unpacking of current subtree. More...
 
abstract bool ReadCore ()
 Reads next Message Pack entry. More...
 
abstract ? long SkipCore ()
 Skips the subtree where the root is the current entry, and returns skipped byte length. More...
 

Properties

abstract ? MessagePackObject Data [get, protected set]
 Gets a last unpacked data. More...
 
virtual MessagePackObject LastReadData [get, protected set]
 Gets a last unpacked data. More...
 
abstract bool IsArrayHeader [get]
 Gets a value indicating whether this instance is positioned to array header. More...
 
abstract bool IsMapHeader [get]
 Gets a value indicating whether this instance is positioned to map header. More...
 
virtual bool IsCollectionHeader [get]
 Gets a value indicating whether this instance is positioned to array or map header. More...
 
abstract long ItemsCount [get]
 Gets the items count for current array or map. More...
 
virtual Stream UnderlyingStream [get]
 Gets the underlying stream to handle direct API. More...
 

Constructor & Destructor Documentation

◆ Unpacker()

MsgPack.Unpacker.Unpacker ( )
protected

Initializes a new instance of the Unpacker class.

Member Function Documentation

◆ Create() [1/8]

static ByteArrayUnpacker MsgPack.Unpacker.Create ( byte[]  source)
static

Creates a new ByteArrayUnpacker from specified byte array.

Parameters
sourceThe source byte array.
Returns
ByteArrayUnpacker instance. This value will not be null.
Exceptions
ArgumentNullExceptionsource is null.

◆ Create() [2/8]

static ByteArrayUnpacker MsgPack.Unpacker.Create ( byte[]  source,
int  startOffset 
)
static

Creates a new ByteArrayUnpacker from specified byte array.

Parameters
sourceThe source byte array.
startOffsetThe effective start offset of the source .
Returns
ByteArrayUnpacker instance. This value will not be null.
Exceptions
ArgumentNullExceptionsource is null.
ArgumentOutOfRangeExceptionstartOffset is negative.
ArgumentExceptionThe array length of source is too small.

◆ Create() [3/8]

static ByteArrayUnpacker MsgPack.Unpacker.Create ( byte[]  source,
int  startOffset,
UnpackerOptions  unpackerOptions 
)
static

Creates a new ByteArrayUnpacker from specified byte array.

Parameters
sourceThe source byte array.
startOffsetThe effective start offset of the source .
unpackerOptionsUnpackerOptions which specifies various options. Specify null to use default options.
Returns
ByteArrayUnpacker instance. This value will not be null.
Exceptions
ArgumentNullExceptionsource is null.
ArgumentOutOfRangeExceptionstartOffset is negative.
ArgumentExceptionThe array length of source is too small.

◆ Create() [4/8]

static ByteArrayUnpacker MsgPack.Unpacker.Create ( byte[]  source,
UnpackerOptions  unpackerOptions 
)
static

Creates a new ByteArrayUnpacker from specified byte array.

Parameters
sourceThe source byte array.
unpackerOptionsUnpackerOptions which specifies various options. Specify null to use default options.
Returns
ByteArrayUnpacker instance. This value will not be null.
Exceptions
ArgumentNullExceptionsource is null.

◆ Create() [5/8]

static Unpacker MsgPack.Unpacker.Create ( Stream  stream)
static

Creates the new Unpacker from specified stream.

Parameters
streamThe stream to be unpacked. This stream will be closed when Packer.Dispose(Boolean) is called.
Returns
Unpacker instance. This value will not be null.
Exceptions
ArgumentNullExceptionstream is null.

◆ Create() [6/8]

static Unpacker MsgPack.Unpacker.Create ( Stream  stream,
bool  ownsStream 
)
static

Creates the new Unpacker from specified stream.

Parameters
streamThe stream to be unpacked.
ownsStreamtrue to close stream when this instance is disposed; false, otherwise.
Returns
Unpacker instance. This value will not be null.
Exceptions
ArgumentNullExceptionstream is null.

◆ Create() [7/8]

static Unpacker MsgPack.Unpacker.Create ( Stream  stream,
PackerUnpackerStreamOptions  streamOptions 
)
static

Creates the new Unpacker from specified stream.

Parameters
streamThe stream to be unpacked.
streamOptionsPackerUnpackerStreamOptions which specifies stream handling options.
Returns
Unpacker instance. This value will not be null.
Exceptions
ArgumentNullExceptionstream is null.

◆ Create() [8/8]

static Unpacker MsgPack.Unpacker.Create ( Stream  stream,
PackerUnpackerStreamOptions  streamOptions,
UnpackerOptions  unpackerOptions 
)
static

Creates the new Unpacker from specified stream.

Parameters
streamThe stream to be unpacked.
streamOptionsPackerUnpackerStreamOptions which specifies stream handling options.
unpackerOptionsUnpackerOptions which specifies various options. Specify null to use default options.
Returns
Unpacker instance. This value will not be null.
Exceptions
ArgumentNullExceptionstream is null.

◆ Dispose() [1/2]

void MsgPack.Unpacker.Dispose ( )

Releases all managed resources.

◆ Dispose() [2/2]

virtual void MsgPack.Unpacker.Dispose ( bool  disposing)
protectedvirtual

Releases unmanaged and optionally managed resources.

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.

◆ Drain()

virtual void MsgPack.Unpacker.Drain ( )
virtual

Drains remaining items in current context.

This method drains remaining items in context of subtree mode unpacker. This method does not any effect for other types of unpacker.

◆ GetEnumerator()

IEnumerator<MessagePackObject> MsgPack.Unpacker.GetEnumerator ( )

Gets IEnumerator<T> to enumerate MessagePackObject from source stream.

Returns
IEnumerator<T> to enumerate MessagePackObject from source stream.

◆ Read()

bool MsgPack.Unpacker.Read ( )

Reads next Message Pack entry.

Returns
true, if position is sucessfully move to next entry; false, if position reaches the tail of the Message Pack stream.
Exceptions
InvalidOperationExceptionThis instance is in 'subtree' mode.
InvalidMessagePackStreamExceptionThe underying stream unexpectedly ended.

◆ ReadArrayLength()

virtual bool MsgPack.Unpacker.ReadArrayLength ( out long  result)
virtual

Reads next array length value from current stream.

Parameters
resultThe array length read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not an array.

◆ ReadBinary()

virtual bool MsgPack.Unpacker.ReadBinary ( out byte[]  result)
virtual

Reads next byte array value from current stream.

Parameters
resultThe byte array read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not a raw.

◆ ReadBoolean()

virtual bool MsgPack.Unpacker.ReadBoolean ( out Boolean  result)
virtual

Reads next Boolean value from current stream.

Parameters
resultThe Boolean value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the Boolean type.

◆ ReadByte()

virtual bool MsgPack.Unpacker.ReadByte ( out Byte  result)
virtual

Reads next Byte value from current stream.

Parameters
resultThe Byte value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the Byte type.

◆ ReadCore()

abstract bool MsgPack.Unpacker.ReadCore ( )
protectedpure virtual

Reads next Message Pack entry.

Returns
true, if position is sucessfully move to next entry; false, if position reaches the tail of the Message Pack stream.

◆ ReadDouble()

virtual bool MsgPack.Unpacker.ReadDouble ( out Double  result)
virtual

Reads next Double value from current stream.

Parameters
resultThe Double value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the Double type.

◆ ReadInt16()

virtual bool MsgPack.Unpacker.ReadInt16 ( out Int16  result)
virtual

Reads next Int16 value from current stream.

Parameters
resultThe Int16 value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the Int16 type.

◆ ReadInt32()

virtual bool MsgPack.Unpacker.ReadInt32 ( out Int32  result)
virtual

Reads next Int32 value from current stream.

Parameters
resultThe Int32 value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the Int32 type.

◆ ReadInt64()

virtual bool MsgPack.Unpacker.ReadInt64 ( out Int64  result)
virtual

Reads next Int64 value from current stream.

Parameters
resultThe Int64 value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the Int64 type.

◆ ReadItem()

MessagePackObject? MsgPack.Unpacker.ReadItem ( )

Gets a current item or collection as single MessagePackObject from the stream.

Returns
A read item or collection from the stream. Or null when stream is ended.

◆ ReadItemData()

MessagePackObject MsgPack.Unpacker.ReadItemData ( )

Gets a current item or collection as single MessagePackObject from the stream.

Returns
A read item or collection from the stream.
Exceptions
InvalidMessagePackStreamExceptionThe stream unexpectedly ends.

◆ ReadMapLength()

virtual bool MsgPack.Unpacker.ReadMapLength ( out long  result)
virtual

Reads next map length value from current stream.

Parameters
resultThe map length read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not a map.

◆ ReadMessagePackExtendedTypeObject()

virtual bool MsgPack.Unpacker.ReadMessagePackExtendedTypeObject ( out MessagePackExtendedTypeObject  result)
virtual

Reads next MessagePackExtendedTypeObject value from current stream.

Parameters
resultThe MessagePackExtendedTypeObject value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the MessagePackExtendedTypeObject type.

◆ ReadNullableBoolean()

virtual bool MsgPack.Unpacker.ReadNullableBoolean ( out Boolean?  result)
virtual

Reads next nullable Boolean value from current stream.

Parameters
resultThe nullable Boolean value read from current stream to be stored when operation is succeeded.
Returns
The nullable Boolean value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable Boolean type.

◆ ReadNullableByte()

virtual bool MsgPack.Unpacker.ReadNullableByte ( out Byte?  result)
virtual

Reads next nullable Byte value from current stream.

Parameters
resultThe nullable Byte value read from current stream to be stored when operation is succeeded.
Returns
The nullable Byte value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable Byte type.

◆ ReadNullableDouble()

virtual bool MsgPack.Unpacker.ReadNullableDouble ( out Double?  result)
virtual

Reads next nullable Double value from current stream.

Parameters
resultThe nullable Double value read from current stream to be stored when operation is succeeded.
Returns
The nullable Double value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable Double type.

◆ ReadNullableInt16()

virtual bool MsgPack.Unpacker.ReadNullableInt16 ( out Int16?  result)
virtual

Reads next nullable Int16 value from current stream.

Parameters
resultThe nullable Int16 value read from current stream to be stored when operation is succeeded.
Returns
The nullable Int16 value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable Int16 type.

◆ ReadNullableInt32()

virtual bool MsgPack.Unpacker.ReadNullableInt32 ( out Int32?  result)
virtual

Reads next nullable Int32 value from current stream.

Parameters
resultThe nullable Int32 value read from current stream to be stored when operation is succeeded.
Returns
The nullable Int32 value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable Int32 type.

◆ ReadNullableInt64()

virtual bool MsgPack.Unpacker.ReadNullableInt64 ( out Int64?  result)
virtual

Reads next nullable Int64 value from current stream.

Parameters
resultThe nullable Int64 value read from current stream to be stored when operation is succeeded.
Returns
The nullable Int64 value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable Int64 type.

◆ ReadNullableMessagePackExtendedTypeObject()

virtual bool MsgPack.Unpacker.ReadNullableMessagePackExtendedTypeObject ( out MessagePackExtendedTypeObject result)
virtual

Reads next nullable MessagePackExtendedTypeObject value from current stream.

Parameters
resultThe nullable MessagePackExtendedTypeObject value read from current stream to be stored when operation is succeeded.
Returns
The nullable MessagePackExtendedTypeObject value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable MessagePackExtendedTypeObject type.

◆ ReadNullableSByte()

virtual bool MsgPack.Unpacker.ReadNullableSByte ( out SByte?  result)
virtual

Reads next nullable SByte value from current stream.

Parameters
resultThe nullable SByte value read from current stream to be stored when operation is succeeded.
Returns
The nullable SByte value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable SByte type.

◆ ReadNullableSingle()

virtual bool MsgPack.Unpacker.ReadNullableSingle ( out Single?  result)
virtual

Reads next nullable Single value from current stream.

Parameters
resultThe nullable Single value read from current stream to be stored when operation is succeeded.
Returns
The nullable Single value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable Single type.

◆ ReadNullableUInt16()

virtual bool MsgPack.Unpacker.ReadNullableUInt16 ( out UInt16?  result)
virtual

Reads next nullable UInt16 value from current stream.

Parameters
resultThe nullable UInt16 value read from current stream to be stored when operation is succeeded.
Returns
The nullable UInt16 value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable UInt16 type.

◆ ReadNullableUInt32()

virtual bool MsgPack.Unpacker.ReadNullableUInt32 ( out UInt32?  result)
virtual

Reads next nullable UInt32 value from current stream.

Parameters
resultThe nullable UInt32 value read from current stream to be stored when operation is succeeded.
Returns
The nullable UInt32 value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable UInt32 type.

◆ ReadNullableUInt64()

virtual bool MsgPack.Unpacker.ReadNullableUInt64 ( out UInt64?  result)
virtual

Reads next nullable UInt64 value from current stream.

Parameters
resultThe nullable UInt64 value read from current stream to be stored when operation is succeeded.
Returns
The nullable UInt64 value read from current data source successfully.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the nullable UInt64 type.

◆ ReadObject()

virtual bool MsgPack.Unpacker.ReadObject ( out MessagePackObject  result)
virtual

Reads next value from current stream.

Parameters
resultThe MessagePackObject which represents a value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.

◆ ReadSByte()

virtual bool MsgPack.Unpacker.ReadSByte ( out SByte  result)
virtual

Reads next SByte value from current stream.

Parameters
resultThe SByte value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the SByte type.

◆ ReadSingle()

virtual bool MsgPack.Unpacker.ReadSingle ( out Single  result)
virtual

Reads next Single value from current stream.

Parameters
resultThe Single value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the Single type.

◆ ReadString()

virtual bool MsgPack.Unpacker.ReadString ( out string  result)
virtual

Reads next utf-8 encoded string value from current stream.

Parameters
resultThe decoded utf-8 encoded string read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not a raw.

◆ ReadSubtree()

Unpacker MsgPack.Unpacker.ReadSubtree ( )

Starts unpacking of current subtree.

Returns
Unpacker to unpack current subtree. This will not be null.
Exceptions
InvalidOperationExceptionThis unpacker is not positioned on the header of array nor map. Or this unpacker already returned Unpacker for subtree and it has not been closed yet.

While subtree unpacker is used, this instance will be 'locked' (called 'subtree' mode) and be unavailable. When you finish to unpack subtree, you must invoke Unpacker.Dispose(), or you faces InvalidOperationException when you use the parent instance. Subtree unpacker can only unpack subtree, so you can handle collection deserialization easily.

◆ ReadSubtreeCore()

abstract Unpacker MsgPack.Unpacker.ReadSubtreeCore ( )
protectedpure virtual

Starts unpacking of current subtree.

Returns
Unpacker to unpack current subtree. This will not be null.

◆ ReadUInt16()

virtual bool MsgPack.Unpacker.ReadUInt16 ( out UInt16  result)
virtual

Reads next UInt16 value from current stream.

Parameters
resultThe UInt16 value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the UInt16 type.

◆ ReadUInt32()

virtual bool MsgPack.Unpacker.ReadUInt32 ( out UInt32  result)
virtual

Reads next UInt32 value from current stream.

Parameters
resultThe UInt32 value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the UInt32 type.

◆ ReadUInt64()

virtual bool MsgPack.Unpacker.ReadUInt64 ( out UInt64  result)
virtual

Reads next UInt64 value from current stream.

Parameters
resultThe UInt64 value read from current stream to be stored when operation is succeeded.
Returns
true if expected value was read from stream; false if no more data on the stream. Note that this method throws exception for unexpected state. See exceptions section.
Exceptions
InvalidMessagePackStreamExceptionCannot read a value because the underlying stream unexpectedly ends.
MessageTypeExceptionA value read from data source is not compatible for the UInt64 type.

◆ Skip()

long? MsgPack.Unpacker.Skip ( )

Skips the subtree where the root is the current entry, and returns skipped byte length.

Returns
Skipped byte length. If the subtree is not completed, then null.

◆ SkipCore()

abstract ? long MsgPack.Unpacker.SkipCore ( )
protectedpure virtual

Skips the subtree where the root is the current entry, and returns skipped byte length.

Returns
Skipped byte length. If the subtree is not completed, then null.

◆ UnpackSubtree()

MessagePackObject? MsgPack.Unpacker.UnpackSubtree ( )

Unpacks current subtree and returns subtree root as array or map.

Returns
An unpacked array or map when current position is array or map header. null when current position is not array nor map header.

◆ UnpackSubtreeData()

MessagePackObject MsgPack.Unpacker.UnpackSubtreeData ( )

Unpacks current subtree and returns subtree root as array or map.

Returns
An unpacked array or map when current position is array or map header. Or LastReadData when current position is not array nor map header.

Property Documentation

◆ Data

abstract ? MessagePackObject MsgPack.Unpacker.Data
getprotected set

Gets a last unpacked data.

A last unpacked data.

<note class="warning"> In default implementation, this property never returning null even if it had not been unpacked any objects. </note> If you use any of direct APIs (methods which return non-MessagePackObject), then this property to be invalidated. Note that the actual value of invalidated this property is undefined.

◆ IsArrayHeader

abstract bool MsgPack.Unpacker.IsArrayHeader
get

Gets a value indicating whether this instance is positioned to array header.

true if this instance is positioned to array header; otherwise, false.

◆ IsCollectionHeader

virtual bool MsgPack.Unpacker.IsCollectionHeader
get

Gets a value indicating whether this instance is positioned to array or map header.

true if this instance is positioned to array or map header; otherwise, false.

◆ IsMapHeader

abstract bool MsgPack.Unpacker.IsMapHeader
get

Gets a value indicating whether this instance is positioned to map header.

true if this instance is positioned to map header; otherwise, false.

◆ ItemsCount

abstract long MsgPack.Unpacker.ItemsCount
get

Gets the items count for current array or map.

The items count for current array or map.

Exceptions
InvalidOperationExceptionBoth of the IsArrayHeader and IsMapHeader are false.

◆ LastReadData

virtual MessagePackObject MsgPack.Unpacker.LastReadData
getprotected set

Gets a last unpacked data.

A last unpacked data. Initial value is MessagePackObject.Nil.

If you use any of direct APIs (methods which return non-MessagePackObject), then this property to be invalidated. Note that the actual value of invalidated this property is undefined.

◆ UnderlyingStream

virtual Stream MsgPack.Unpacker.UnderlyingStream
getprotected

Gets the underlying stream to handle direct API.

Exceptions
NotSupportedExceptionThis instance does not supoort direct API.

The documentation for this class was generated from the following files:
  • MsgPackSources/Unpacker.cs
  • MsgPackSources/Unpacker.Unpacking.cs