UnpackByte() public static method

Unpacks System.Byte value from the specified Stream.

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

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

/// is null. /// /// The of is false. /// /// is not valid MessagePack stream. /// Note that the state of will be unpredictable espicially it is not seekable. /// /// The unpacked result in the is not compatible to . /// Note that the state of will be unpredictable espicially it is not seekable. ///
public static UnpackByte ( Stream source ) : Byte
source Stream The which contains Message Pack binary stream.
return Byte
示例#1
0
        private static void TestByte(Byte value)
        {
            var output = new MemoryStream();

            Packer.Create(output).Pack(value);
            Assert.AreEqual(value, Unpacking.UnpackByte(new MemoryStream(output.ToArray())));
            Assert.AreEqual(value, Unpacking.UnpackByte(output.ToArray()).Value);
        }