UnpackBinary() public static method

Unpacks the raw binary from the head of specified byte array.

Invocation of this method is equivalant to call UnpackBinary(byte[], int) with offset is 0.

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

/// is null. /// /// is empty. /// /// is not valid MessagePack stream. /// /// The unpacked result in the is not compatible to []. /// /// The items count of the underlying collection body is over . ///
public static UnpackBinary ( byte source ) : UnpackingResult
source byte The byte array which contains Message Pack binary stream.
return UnpackingResult
Ejemplo n.º 1
0
 public void TestUnpackBinary_Stream_ReadOnlyStream()
 {
     using (var stream = new WrapperStream(new MemoryStream(), canRead: false))
     {
         Assert.Throws <ArgumentException>(() => Unpacking.UnpackBinary(stream));
     }
 }
Ejemplo n.º 2
0
 public void TestUnpackBinary_EofInBody()
 {
     Assert.Throws <InvalidMessagePackStreamException>(() => Unpacking.UnpackBinary(new byte[] { 0xA1 }));
 }
Ejemplo n.º 3
0
 public void TestUnpackBinary_EofInBody()
 {
     Assert.Throws <UnpackException>(() => Unpacking.UnpackBinary(new byte[] { 0xA1 }));
 }
Ejemplo n.º 4
0
 public void TestUnpackBinary_BinaryLengthIsGreaterThanInt32MaxValue()
 {
     Assert.Throws <MessageNotSupportedException>(() => Unpacking.UnpackBinary(new byte[] { 0xDB, 0x80, 0x00, 0x00, 0x00, 0xFF }));
 }
Ejemplo n.º 5
0
 public void TestUnpackBinary_EofInHeader()
 {
     Assert.Throws <UnpackException>(() => Unpacking.UnpackBinary(new byte[] { 0xDA, 0x1 }));
 }