Example #1
0
 public void TestBytes_Splitted()
 {
     foreach (
         var count in
         new[]
     {
         0,                                 // empty
         1,                                 // only one
         2,                                 // minimum multiple
         0xFF,                              // max bin8 size
         0x100,                             // min bin16 size
         0xffff,                            // max bin16 size
         0x10000,                           // min bin32 size
     }
         )
     {
         using (var output = new MemoryStream())
         {
             Packer.Create(output).PackBinary(Enumerable.Range(0, count).Select(i => ( byte )(i % Byte.MaxValue)).ToArray());
             output.Position = 0;
             using (var splitted = new SplittingStream(output))
             {
                 Assert.That(
                     Enumerable.Range(0, count).Select(i => ( byte )(i % Byte.MaxValue)).ToArray(),
                     Is.EqualTo(Unpacking.UnpackObject(splitted).AsBinary())
                     );
             }
         }
     }
 }
Example #2
0
        public void TestDictionary_Splitted()
        {
            foreach (
                var count in
                new[]
            {
                0,       // empty
                1,       // only one
                2,       // minimum multiple
                0xf,     // max fix map size
                0x10,    // min map16 size
#if !AOT                 // Too heavy for mobile envs.
                0xffff,  // max map16 size
                0x10000, // min map32 size
#endif // !AOT
            }
                )
            {
                using (var output = new MemoryStream())
                {
                    Packer.Create(output).PackDictionary(Enumerable.Range(0, count).ToDictionary(item => item.ToString(), item => item));
                    output.Position = 0;
                    using (var splitted = new SplittingStream(output))
                    {
                        Assert.That(
                            Enumerable.Range(0, count).ToDictionary(item => item.ToString(), item => item),
                            Is.EqualTo(Unpacking.UnpackObject(splitted).AsDictionary().ToDictionary(kv => kv.Key.AsString(), kv => kv.Value.AsInt32()))
                            );
                    }
                }
            }
        }
Example #3
0
 public void TestChars_Splitted()
 {
     foreach (
         var count in
         new[]
     {
         0,                                 // empty
         1,                                 // only one
         2,                                 // minimum multiple
         0x1f,                              // max fix raw size
         0x20,                              // min str8 size
         0xFF,                              // max str8 size
         0x100,                             // min str16 size
         0xffff,                            // max str16 size
         0x10000,                           // min str32 size
     }
         )
     {
         using (var output = new MemoryStream())
         {
             Packer.Create(output).PackString(String.Concat(Enumerable.Range(0, count).Select(i => (i % 10).ToString()).ToArray()));
             output.Position = 0;
             using (var splitted = new SplittingStream(output))
             {
                 Assert.AreEqual(
                     String.Concat(Enumerable.Range(0, count).Select(i => (i % 10).ToString()).ToArray()),
                     Unpacking.UnpackObject(splitted).AsString()
                     );
             }
         }
     }
 }
Example #4
0
		public void TestUnpackFixStr_0_AsString_Read_JustLength_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xA0 }
					.Concat( Enumerable.Repeat( ( byte )'A', 0 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Assert.IsTrue( unpacker.Read() );
#pragma warning disable 612,618
				var result = unpacker.Data;
#pragma warning restore 612,618
				Assert.IsTrue( result.HasValue );
				Assert.That( ( String )result.Value, Is.EqualTo( new String( 'A', 0 ) ) );
				Assert.That( result.Value.UnderlyingType, Is.EqualTo( typeof( String ) ) );

				// raw/str always can be byte[]
				var asBinary = ( byte[] )result.Value;
				var asString = ( String )result.Value;
				Assert.That( result.Value.IsTypeOf( typeof( string ) ).GetValueOrDefault() );
				Assert.That( result.Value.IsTypeOf( typeof( byte[] ) ).GetValueOrDefault() );
			}
		}
Example #5
0
        public void TestArray_Splitted()
        {
            foreach (
                var count in
                new[]
            {
                0,       // empty
                1,       // only one
                2,       // minimum multiple
                0xf,     // max fix array size
                0x10,    // min array16 size
#if !AOT                 // Too heavy for mobile envs.
                0xffff,  // max array16 size
                0x10000, // min array32 size
#endif // !AOT
            }
                )
            {
                using (var output = new MemoryStream())
                {
                    Packer.Create(output).PackCollection(Enumerable.Range(0, count).ToArray());
                    output.Position = 0;
                    using (var splitted = new SplittingStream(output))
                    {
                        Assert.That(
                            Enumerable.Range(0, count).ToArray(),
                            Is.EqualTo(Unpacking.UnpackObject(splitted).AsEnumerable().Select(item => item.AsInt32()).ToArray())
                            );
                    }
                }
            }
        }
		public void TestRead_Int64MinValue_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xD3, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Assert.IsTrue( unpacker.Read() );
#pragma warning disable 612,618
				var result = unpacker.Data;
#pragma warning restore 612,618
				Assert.IsTrue( result.HasValue );
				Assert.That( ( System.Int64 )result.Value, Is.EqualTo( -9223372036854775808 ) );
			}
		}
		public void TestByte_Splitted()
		{
			var value = Byte.MaxValue;
			using( var output = new MemoryStream() )
			{
				Packer.Create( output ).Pack( value );
				output.Position = 0;
				using( var splitted = new SplittingStream( output ) )
				{
					var mpo = Unpacking.UnpackObject( splitted );
					Assert.AreEqual( value, ( Byte )mpo );
					Assert.AreEqual( value, mpo.AsByte() );
				}
			}
		}
        public void TestByte_Splitted()
        {
            var value = Byte.MaxValue;

            using (var output = new MemoryStream())
            {
                Packer.Create(output).Pack(value);
                output.Position = 0;
                using (var splitted = new SplittingStream(output))
                {
                    var mpo = Unpacking.UnpackObject(splitted);
                    Assert.AreEqual(value, ( Byte )mpo);
                    Assert.AreEqual(value, mpo.AsByte());
                }
            }
        }
Example #9
0
		public void TestRead_FixExt1_AndBinaryLengthIs1JustLength_Success_Splitted()
		{
			var typeCode = ( byte )( Math.Abs( Environment.TickCount ) % 128 );
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xD4, typeCode }
					.Concat( Enumerable.Repeat( ( byte )0xFF, 1 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Assert.IsTrue( unpacker.Read() );
#pragma warning disable 612,618
				var result = unpacker.Data;
#pragma warning restore 612,618
				Assert.IsTrue( result.HasValue );
				var actual = ( MessagePackExtendedTypeObject )result;
				Assert.That( actual.TypeCode, Is.EqualTo( typeCode ) );
				Assert.That( actual.Body, Is.Not.Null );
				Assert.That( actual.Body.Length, Is.EqualTo( 1 ) );
			}
		}
Example #10
0
 public void TestExts_Splitted()
 {
     foreach (
         var count in
         new[]
     {
         0,                                 // empty
         1,                                 // fixext1
         2,                                 // fixext2
         4,                                 // fixext4
         8,                                 // fixext8
         16,                                // fixext16
         17,                                // min ext8 size
         0xff,                              // max ext8 size
         0x100,                             // min ext16 size
         0xffff,                            // max ext16 size
         0x10000,                           // min ext32 size
     }
         )
     {
         using (var output = new MemoryStream())
         {
             var value = new MessagePackExtendedTypeObject(
                 1, Enumerable.Range(0, count).Select(i => ( byte )(i % 0x100)).ToArray());
             Packer.Create(output, PackerCompatibilityOptions.None).PackExtendedTypeValue(value);
             output.Position = 0;
             using (var splitted = new SplittingStream(output))
             {
                 Assert.AreEqual(
                     value,
                     Unpacking.UnpackObject(splitted).AsMessagePackExtendedTypeObject()
                     );
             }
         }
     }
 }
		public void TestReadNullableInt64_NegativeFixNumMinValue_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xE0 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Int64? result;
				Assert.IsTrue( unpacker.ReadNullableInt64( out result ) );
				Assert.That( result.Value, Is.EqualTo( -32 ) );
			}
		}
Example #12
0
		public void TestUnpackBin32_65536_ReadString_TooShort_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xC6, 0, 1, 0, 0 }
					.Concat( Enumerable.Repeat( ( byte )'A', 65535 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				String result;
				Assert.Throws<InvalidMessagePackStreamException>( () => unpacker.ReadString( out result ) );
			}
		}
Example #13
0
		public void TestUnpackStr8_1_AsString_Read_TooShort_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xD9, 1 }
					.Concat( Enumerable.Repeat( ( byte )'A', 0 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Assert.Throws<InvalidMessagePackStreamException>( () => unpacker.Read() );
			}
		}
		public async Task TestReadNullableSingleAsync_SingleNaNPositiveMaxValue_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xCA, 0x7F, 0xFF, 0xFF, 0xFF } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Single? result;
				var ret = await unpacker.ReadNullableSingleAsync();
				Assert.IsTrue( ret.Success );
				result = ret.Value;
				Assert.That( Single.IsNaN( result.Value ) );
			}
		}
Example #15
0
		public void TestUnpackBin32_65535_AsBinary_Read_TooShort_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xC6, 0, 0, 0xFF, 0xFF }
					.Concat( Enumerable.Repeat( ( byte )0xFF, 65534 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Assert.Throws<InvalidMessagePackStreamException>( () => unpacker.Read() );
			}
		}
Example #16
0
		public void TestUnpackBin16_256_ReadBinary_TooShort_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xC5, 1, 0 }
					.Concat( Enumerable.Repeat( ( byte )0xFF, 255 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Byte[] result;
				Assert.Throws<InvalidMessagePackStreamException>( () => unpacker.ReadBinary( out result ) );
			}
		}
		public void TestRead_PlusOne_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0x1 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Assert.IsTrue( unpacker.Read() );
#pragma warning disable 612,618
				var result = unpacker.Data;
#pragma warning restore 612,618
				Assert.IsTrue( result.HasValue );
				Assert.That( ( System.UInt64 )result.Value, Is.EqualTo( 1 ) );
			}
		}
		public void TestReadNullableUInt64_Zero_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0x0 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				UInt64? result;
				Assert.IsTrue( unpacker.ReadNullableUInt64( out result ) );
				Assert.That( result.Value, Is.EqualTo( 0 ) );
			}
		}
		public void TestReadInt64_Int64MinValue_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xD3, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Int64 result;
				Assert.IsTrue( unpacker.ReadInt64( out result ) );
				Assert.That( result, Is.EqualTo( -9223372036854775808 ) );
			}
		}
		public async Task TestReadNullableUInt64Async_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xC0 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				UInt64? result;
				var ret = await unpacker.ReadNullableUInt64Async();
				Assert.IsTrue( ret.Success );
				result = ret.Value;
				Assert.That( result, Is.Null );
			}
		}
		public async Task TestReadNullableDoubleAsync_DoublePositiveInfinity_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xCB, 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Double? result;
				var ret = await unpacker.ReadNullableDoubleAsync();
				Assert.IsTrue( ret.Success );
				result = ret.Value;
				Assert.That( Double.IsPositiveInfinity( result.Value ) );
			}
		}
		public async Task TestReadAsync_DoublePositiveInfinity_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xCB, 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Assert.IsTrue( await unpacker.ReadAsync() );
#pragma warning disable 612,618
				var result = unpacker.Data;
#pragma warning restore 612,618
				Assert.IsTrue( result.HasValue );
				Assert.That( Double.IsPositiveInfinity( ( System.Double )result.Value ) );
			}
		}
		public async Task TestReadDoubleAsync_DoubleNaNNegativeMaxValue_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xCB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Double result;
				var ret = await unpacker.ReadDoubleAsync();
				Assert.IsTrue( ret.Success );
				result = ret.Value;
				Assert.That( Double.IsNaN( result ) );
			}
		}
Example #24
0
		public void TestUnpackStr32_0_AsBinary_Read_HasExtra_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xDB, 0, 0, 0, 0 }
					.Concat( Enumerable.Repeat( ( byte )0xFF, 1 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Assert.IsTrue( unpacker.Read() );
#pragma warning disable 612,618
				var result = unpacker.Data;
#pragma warning restore 612,618
				Assert.IsTrue( result.HasValue );

				// raw/str always can be byte[]
				var asBinary = ( byte[] )result.Value;
				var asString = ( String )result.Value;
				Assert.That( result.Value.IsTypeOf( typeof( string ) ).GetValueOrDefault() );
				Assert.That( result.Value.IsTypeOf( typeof( byte[] ) ).GetValueOrDefault() );
			}
		}
Example #25
0
		public void TestUnpackBin16_255_ReadBinary_HasExtra_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xC5, 0, 0xFF }
					.Concat( Enumerable.Repeat( ( byte )0xFF, 256 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Byte[] result;
				Assert.IsTrue( unpacker.ReadBinary( out result ) );
				Assert.That( result, Is.EqualTo( Enumerable.Repeat( 0xFF, 255 ).ToArray() ) );
			}
		}
		public void TestReadUInt64_PlusOne_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0x1 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				UInt64 result;
				Assert.IsTrue( unpacker.ReadUInt64( out result ) );
				Assert.That( result, Is.EqualTo( 1 ) );
			}
		}
Example #27
0
		public void TestUnpackBin16_65535_AsBinary_Read_JustLength_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xC5, 0xFF, 0xFF }
					.Concat( Enumerable.Repeat( ( byte )0xFF, 65535 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Assert.IsTrue( unpacker.Read() );
#pragma warning disable 612,618
				var result = unpacker.Data;
#pragma warning restore 612,618
				Assert.IsTrue( result.HasValue );
				Assert.That( ( Byte[] )result.Value, Is.EqualTo( Enumerable.Repeat( 0xFF, 65535 ).ToArray() ) );
				Assert.That( result.Value.UnderlyingType, Is.EqualTo( typeof( Byte[] ) ) );

				// raw/str always can be byte[]
				var asBinary = ( byte[] )result.Value;
				Assert.Throws<InvalidOperationException>( () => { var asString = ( String )result.Value; } );
				Assert.That( result.Value.IsTypeOf( typeof( string ) ).GetValueOrDefault(), Is.False );
				Assert.That( result.Value.IsTypeOf( typeof( byte[] ) ).GetValueOrDefault() );
			}
		}
		public async Task TestReadDoubleAsync_DoubleEpsilon_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xCB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Double result;
				var ret = await unpacker.ReadDoubleAsync();
				Assert.IsTrue( ret.Success );
				result = ret.Value;
				Assert.That( Double.Epsilon.Equals( result ) );
			}
		}
Example #29
0
		public void TestUnpackBin32_65536_ReadBinary_JustLength_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xC6, 0, 1, 0, 0 }
					.Concat( Enumerable.Repeat( ( byte )0xFF, 65536 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Byte[] result;
				Assert.IsTrue( unpacker.ReadBinary( out result ) );
				Assert.That( result, Is.EqualTo( Enumerable.Repeat( 0xFF, 65536 ).ToArray() ) );
			}
		}
		public async Task TestReadNullableDoubleAsync_DoubleMaxValue_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xCB, 0x7F, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Double? result;
				var ret = await unpacker.ReadNullableDoubleAsync();
				Assert.IsTrue( ret.Success );
				result = ret.Value;
				Assert.That( Double.MaxValue.Equals( result.Value ) );
			}
		}
Example #31
0
		public void TestUnpackStr8_0_ReadString_JustLength_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xD9, 0 }
					.Concat( Enumerable.Repeat( ( byte )'A', 0 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				String result;
				Assert.IsTrue( unpacker.ReadString( out result ) );
				Assert.That( result, Is.EqualTo( new String( 'A', 0 ) ) );
			}
		}
		public async Task TestReadSingleAsync_SingleNegativeInfinity_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xCA, 0xFF, 0x80, 0x00, 0x00 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Single result;
				var ret = await unpacker.ReadSingleAsync();
				Assert.IsTrue( ret.Success );
				result = ret.Value;
				Assert.That( Single.IsNegativeInfinity( result ) );
			}
		}
Example #33
0
		public void TestUnpackBin32_65536_AsString_Read_HasExtra_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xC6, 0, 1, 0, 0 }
					.Concat( Enumerable.Repeat( ( byte )'A', 65537 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Assert.IsTrue( unpacker.Read() );
#pragma warning disable 612,618
				var result = unpacker.Data;
#pragma warning restore 612,618
				Assert.IsTrue( result.HasValue );

				// raw/str always can be byte[]
				var asBinary = ( byte[] )result.Value;
				Assert.Throws<InvalidOperationException>( () => { var asString = ( String )result.Value; } );
				Assert.That( result.Value.IsTypeOf( typeof( string ) ).GetValueOrDefault(), Is.False );
				Assert.That( result.Value.IsTypeOf( typeof( byte[] ) ).GetValueOrDefault() );
			}
		}
		public async Task TestReadAsync_SingleNaNNegativeMaxValue_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xCA, 0xFF, 0xFF, 0xFF, 0xFF } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Assert.IsTrue( await unpacker.ReadAsync() );
#pragma warning disable 612,618
				var result = unpacker.Data;
#pragma warning restore 612,618
				Assert.IsTrue( result.HasValue );
				Assert.That( Single.IsNaN( ( System.Single )result.Value ) );
			}
		}
Example #35
0
		public void TestUnpackBin32_65536_ReadString_HasExtra_Splitted()
		{
			using( var buffer =
				new MemoryStream( 
					new byte[] { 0xC6, 0, 1, 0, 0 }
					.Concat( Enumerable.Repeat( ( byte )'A', 65537 ) ).ToArray()
				)
			)
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				String result;
				Assert.IsTrue( unpacker.ReadString( out result ) );
				Assert.That( result, Is.EqualTo( new String( 'A', 65536 ) ) );
			}
		}
		public async Task TestReadNullableDoubleAsync_DoubleNegativeZero_Splitted()
		{
			using( var buffer = new MemoryStream( new byte[] { 0xCB, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } ) )
			using( var splitted = new SplittingStream( buffer ) )
			using( var unpacker = Unpacker.Create( splitted ) )
			{
				Double? result;
				var ret = await unpacker.ReadNullableDoubleAsync();
				Assert.IsTrue( ret.Success );
				result = ret.Value;
				Assert.That( ( -0.0 ).Equals( result.Value ) );
			}
		}