Example #1
0
        public void FloatBoundaryTest()
        {
            var capacity = 10;

            using var buffer = new MessagePackBuffer(capacity);
            var serializer = MessagePackSerializersRepository.Get <float>();

            serializer.Serialize(float.MaxValue, buffer);
            serializer.Serialize(float.MinValue, buffer);
            Assert.Equal(buffer.Length, capacity);

            var firstValue = buffer.GetPart(0, 5);

            Assert.Equal(firstValue[0], 202);
            Assert.Equal(firstValue[1], 127);
            Assert.Equal(firstValue[2], 127);
            Assert.Equal(firstValue[3], 255);
            Assert.Equal(firstValue[4], 255);

            var secondValue = buffer.GetPart(5, 5);

            Assert.Equal(secondValue[0], 202);
            Assert.Equal(secondValue[1], 255);
            Assert.Equal(secondValue[2], 127);
            Assert.Equal(secondValue[3], 255);
            Assert.Equal(secondValue[4], 255);
        }
Example #2
0
        public void StringTest()
        {
            var shortStr = new string(new char[31]);
            var str8     = new string(new char[byte.MaxValue - 10]);
            var str16    = new string(new char[ushort.MaxValue - 10]);
            var str32    = new string(new char[ushort.MaxValue + 10]);

            using var buffer = new MessagePackBuffer();
            var serializer = MessagePackSerializersRepository.Get <string>();

            serializer.Serialize(null, buffer);
            serializer.Serialize("", buffer);
            serializer.Serialize(shortStr, buffer);
            serializer.Serialize(str8, buffer);
            serializer.Serialize(str16, buffer);
            serializer.Serialize(str32, buffer);

            buffer.ResetPosition();
            Assert.Equal(null, serializer.Deserialize(buffer));
            Assert.Equal("", serializer.Deserialize(buffer));

            var str    = serializer.Deserialize(buffer);
            var count  = str.Length;
            var count2 = shortStr.Length;

            Assert.Equal(shortStr, str);

            Assert.Equal(str8, serializer.Deserialize(buffer));
            Assert.Equal(str16, serializer.Deserialize(buffer));
            Assert.Equal(str32, serializer.Deserialize(buffer));
        }
Example #3
0
 public MessagePackSerializerValueTuple4()
 {
     _item1Serializer = MessagePackSerializersRepository.Get <T1>();
     _item2Serializer = MessagePackSerializersRepository.Get <T2>();
     _item3Serializer = MessagePackSerializersRepository.Get <T3>();
     _item4Serializer = MessagePackSerializersRepository.Get <T4>();
 }
Example #4
0
        public void DoubleBoundaryTest()
        {
            var capacity = 18;

            using var buffer = new MessagePackBuffer(capacity);
            var serializer = MessagePackSerializersRepository.Get <double>();

            serializer.Serialize(double.MinValue, buffer);
            serializer.Serialize(double.MaxValue, buffer);
            Assert.Equal(buffer.Length, capacity);

            var firstValue = buffer.GetPart(0, 9);

            Assert.Equal(firstValue[0], 203);
            Assert.Equal(firstValue[1], 255);
            Assert.Equal(firstValue[2], 239);
            Assert.Equal(firstValue[3], 255);
            Assert.Equal(firstValue[4], 255);
            Assert.Equal(firstValue[5], 255);
            Assert.Equal(firstValue[6], 255);
            Assert.Equal(firstValue[7], 255);
            Assert.Equal(firstValue[8], 255);

            var secondValue = buffer.GetPart(9, 9);

            Assert.Equal(secondValue[0], 203);
            Assert.Equal(secondValue[1], 127);
            Assert.Equal(secondValue[2], 239);
            Assert.Equal(secondValue[3], 255);
            Assert.Equal(secondValue[4], 255);
            Assert.Equal(secondValue[5], 255);
            Assert.Equal(secondValue[6], 255);
            Assert.Equal(secondValue[7], 255);
            Assert.Equal(secondValue[8], 255);
        }
Example #5
0
        public void SignedNumbersTest()
        {
            using var buffer = new MessagePackBuffer();

            var intSerializer   = MessagePackSerializersRepository.Get <int>();
            var sbyteSerializer = MessagePackSerializersRepository.Get <sbyte>();
            var shortSerializer = MessagePackSerializersRepository.Get <short>();
            var longSerializer  = MessagePackSerializersRepository.Get <long>();

            intSerializer.Serialize(-1, buffer);
            intSerializer.Serialize(1, buffer);
            sbyteSerializer.Serialize(sbyte.MinValue, buffer);
            sbyteSerializer.Serialize(sbyte.MaxValue, buffer);
            shortSerializer.Serialize(short.MinValue, buffer);
            shortSerializer.Serialize(short.MaxValue, buffer);
            intSerializer.Serialize(int.MinValue, buffer);
            intSerializer.Serialize(int.MaxValue, buffer);
            longSerializer.Serialize(long.MinValue, buffer);
            longSerializer.Serialize(long.MaxValue, buffer);

            buffer.ResetPosition();
            Assert.Equal(-1, intSerializer.Deserialize(buffer));
            Assert.Equal(1, intSerializer.Deserialize(buffer));
            Assert.Equal(sbyte.MinValue, sbyteSerializer.Deserialize(buffer));
            Assert.Equal(sbyte.MaxValue, sbyteSerializer.Deserialize(buffer));
            Assert.Equal(short.MinValue, shortSerializer.Deserialize(buffer));
            Assert.Equal(short.MaxValue, shortSerializer.Deserialize(buffer));
            Assert.Equal(int.MinValue, intSerializer.Deserialize(buffer));
            Assert.Equal(int.MaxValue, intSerializer.Deserialize(buffer));
            Assert.Equal(long.MinValue, longSerializer.Deserialize(buffer));
            Assert.Equal(long.MaxValue, longSerializer.Deserialize(buffer));
        }
 public MessagePackSerializerValueTuple7()
 {
     _item1Serializer = MessagePackSerializersRepository.Get <T1>();
     _item2Serializer = MessagePackSerializersRepository.Get <T2>();
     _item3Serializer = MessagePackSerializersRepository.Get <T3>();
     _item4Serializer = MessagePackSerializersRepository.Get <T4>();
     _item5Serializer = MessagePackSerializersRepository.Get <T5>();
     _item6Serializer = MessagePackSerializersRepository.Get <T6>();
     _item7Serializer = MessagePackSerializersRepository.Get <T7>();
 }
Example #7
0
        public void BoolTest()
        {
            using var buffer = new MessagePackBuffer(2);
            var serializer = MessagePackSerializersRepository.Get <bool>();

            serializer.Serialize(false, buffer);
            serializer.Serialize(true, buffer);

            var data = buffer.GetAll();

            Assert.Equal(2, data.Length);
            Assert.Equal(0xc2, data[0]);
            Assert.Equal(0xc3, data[1]);
        }
Example #8
0
        public void NullStringTest()
        {
            var capacity = 1;

            using var buffer = new MessagePackBuffer(capacity);
            var serializer = MessagePackSerializersRepository.Get <string>();

            serializer.Serialize(null, buffer);
            Assert.Equal(buffer.Length, capacity);

            var data = buffer.GetAll();

            Assert.Equal(data[0], 192);
        }
Example #9
0
        public void DateTimeTest()
        {
            var dateTimeZero = new DateTime(1970, 1, 1);
            var dateTime     = new DateTime(2020, 1, 1, 1, 1, 1, 1);

            using var buffer = new MessagePackBuffer();
            var serializer = MessagePackSerializersRepository.Get <DateTime>();

            serializer.Serialize(dateTimeZero, buffer);
            serializer.Serialize(dateTime, buffer);

            buffer.ResetPosition();
            Assert.Equal(dateTimeZero, serializer.Deserialize(buffer));
            Assert.Equal(dateTime, serializer.Deserialize(buffer));
        }
Example #10
0
        public void ByteBoundaryTest()
        {
            var capacity = 2;

            using var buffer = new MessagePackBuffer(capacity);
            var serializer = MessagePackSerializersRepository.Get <byte>();

            serializer.Serialize(byte.MaxValue, buffer);
            Assert.Equal(buffer.Length, capacity);

            var data = buffer.GetAll();

            Assert.Equal(data[0], 204);
            Assert.Equal(data[1], 255);
        }
Example #11
0
        public void UshortBoundaryTest()
        {
            var capacity = 3;

            using var buffer = new MessagePackBuffer(capacity);
            var serializer = MessagePackSerializersRepository.Get <ushort>();

            serializer.Serialize(ushort.MaxValue, buffer);
            Assert.Equal(buffer.Length, capacity);

            var data = buffer.GetAll();

            Assert.Equal(data[0], 205);
            Assert.Equal(data[1], 255);
            Assert.Equal(data[2], 255);
        }
        public void TestCustomSerialization()
        {
            using var buffer = new MessagePackBuffer();
            var writer = new MessagePackWriter(buffer);

            var value      = new TestSerializable(0x1);
            var serializer = MessagePackSerializersRepository.Get <TestSerializable>();

            serializer.Serialize(value, writer);

            buffer.ResetPosition();

            var reader            = new MessagePackReader(buffer);
            var deserializedValue = serializer.Deserialize(reader);

            Assert.Equal(value.Value, deserializedValue.Value);
        }
Example #13
0
        public void FloatingPointNumbersTest()
        {
            using var buffer = new MessagePackBuffer();

            var floatSerializer  = MessagePackSerializersRepository.Get <float>();
            var doubleSerializer = MessagePackSerializersRepository.Get <double>();

            floatSerializer.Serialize(float.MaxValue, buffer);
            floatSerializer.Serialize(float.MinValue, buffer);
            doubleSerializer.Serialize(double.MaxValue, buffer);
            doubleSerializer.Serialize(double.MinValue, buffer);

            buffer.ResetPosition();
            Assert.Equal(float.MaxValue, floatSerializer.Deserialize(buffer));
            Assert.Equal(float.MinValue, floatSerializer.Deserialize(buffer));
            Assert.Equal(double.MaxValue, doubleSerializer.Deserialize(buffer));
            Assert.Equal(double.MinValue, doubleSerializer.Deserialize(buffer));
        }
Example #14
0
        public void SbyteBoundaryTest()
        {
            var capacity = 3;

            using var buffer = new MessagePackBuffer(capacity);
            var sbyteSerializer = MessagePackSerializersRepository.Get <sbyte>();

            sbyteSerializer.Serialize(sbyte.MinValue, buffer);
            sbyteSerializer.Serialize(sbyte.MaxValue, buffer);

            Assert.Equal(buffer.Length, capacity);

            var data = buffer.GetAll();

            Assert.Equal(data[0], 208);
            Assert.Equal(data[1], 128);
            Assert.Equal(data[2], 127);
        }
Example #15
0
        public void BinaryTest()
        {
            var binaryData8  = new byte[byte.MaxValue - 1];
            var binaryData16 = new byte[ushort.MaxValue - 1];
            var binaryData32 = new byte[ushort.MaxValue + 1];

            using var buffer = new MessagePackBuffer();
            var serializer = MessagePackSerializersRepository.Get <byte[]>();

            serializer.Serialize(binaryData8, buffer);
            serializer.Serialize(binaryData16, buffer);
            serializer.Serialize(binaryData32, buffer);

            buffer.ResetPosition();
            Assert.Equal(binaryData8, serializer.Deserialize(buffer));
            Assert.Equal(binaryData16, serializer.Deserialize(buffer));
            Assert.Equal(binaryData32, serializer.Deserialize(buffer));
        }
        private void TestCompatibility <T>(T[] values)
        {
            using var buffer = new MessagePackBuffer();
            using var packer = Packer.Create(buffer);

            var cliSerializer     = MessagePackSerializer.Get <T>();
            var sekougiSerializer = MessagePackSerializersRepository.Get <T>();

            foreach (var value in values)
            {
                cliSerializer.PackTo(packer, value);
            }

            buffer.ResetPosition();
            foreach (var value in values)
            {
                var deserializedValue = sekougiSerializer.Deserialize(buffer);
                Assert.Equal(value, deserializedValue);
            }
        }
Example #17
0
        public void UnsignedNumbersTest()
        {
            using var buffer = new MessagePackBuffer();

            var uintSerializer   = MessagePackSerializersRepository.Get <uint>();
            var byteSerializer   = MessagePackSerializersRepository.Get <byte>();
            var ushortSerializer = MessagePackSerializersRepository.Get <ushort>();
            var ulongSerializer  = MessagePackSerializersRepository.Get <ulong>();

            byteSerializer.Serialize(byte.MaxValue, buffer);
            ushortSerializer.Serialize(ushort.MaxValue, buffer);
            uintSerializer.Serialize(uint.MaxValue, buffer);
            ulongSerializer.Serialize(ulong.MaxValue, buffer);

            buffer.ResetPosition();
            Assert.Equal(byte.MaxValue, byteSerializer.Deserialize(buffer));
            Assert.Equal(ushort.MaxValue, ushortSerializer.Deserialize(buffer));
            Assert.Equal(uint.MaxValue, uintSerializer.Deserialize(buffer));
            Assert.Equal(ulong.MaxValue, ulongSerializer.Deserialize(buffer));
        }
Example #18
0
        public void TimeStamp32Test()
        {
            var capacity = 6;

            using var buffer = new MessagePackBuffer(6);
            var serializer = MessagePackSerializersRepository.Get <DateTime>();

            var date = new DateTime(1970, 1, 1);

            serializer.Serialize(date, buffer);
            Assert.Equal(buffer.Length, capacity);

            var data = buffer.GetAll();

            Assert.Equal(data[0], 214);
            Assert.Equal(data[1], 255);
            Assert.Equal(data[2], 0);
            Assert.Equal(data[3], 0);
            Assert.Equal(data[4], 0);
            Assert.Equal(data[5], 0);
        }
Example #19
0
        public void ArrayTest()
        {
            var arrayEmpty = new string[0];
            var array1     = new string[1];
            var array16    = new string[ushort.MaxValue - 1];
            var array32    = new string[ushort.MaxValue + 1];

            using var buffer = new MessagePackBuffer();
            var serializer = MessagePackSerializersRepository.Get <string[]>();

            serializer.Serialize(arrayEmpty, buffer);
            serializer.Serialize(array1, buffer);
            serializer.Serialize(array16, buffer);
            serializer.Serialize(array32, buffer);

            buffer.ResetPosition();
            Assert.Equal(arrayEmpty, serializer.Deserialize(buffer));
            Assert.Equal(array1, serializer.Deserialize(buffer));
            Assert.Equal(array16, serializer.Deserialize(buffer));
            Assert.Equal(array32, serializer.Deserialize(buffer));
        }
Example #20
0
        public void ValueTuple1Test()
        {
            using var buffer = new MessagePackBuffer();
            var serializer1 = MessagePackSerializersRepository.Get <ValueTuple <int> >();
            var serializer2 = MessagePackSerializersRepository.Get <ValueTuple <int, byte> >();
            var serializer3 = MessagePackSerializersRepository.Get <ValueTuple <int, byte, sbyte> >();
            var serializer4 = MessagePackSerializersRepository.Get <ValueTuple <int, byte, sbyte, double> >();
            var serializer5 = MessagePackSerializersRepository.Get <ValueTuple <int, byte, sbyte, uint, short> >();
            var serializer6 = MessagePackSerializersRepository.Get <ValueTuple <int, byte, sbyte, uint, short, float> >();
            var serializer7 = MessagePackSerializersRepository.Get <ValueTuple <int, byte, sbyte, uint, short, float, double> >();
            var serializer8 = MessagePackSerializersRepository.Get <ValueTuple <string, int, int, int, int, int, int, ValueTuple <int> > >();

            var tuple1 = new ValueTuple <int>(1);
            var tuple2 = (1, (byte)1);
            var tuple3 = (1, (byte)1, (sbyte)1);
            var tuple4 = (1, (byte)1, (sbyte)1, 1d);
            var tuple5 = (1, (byte)1, (sbyte)1, (uint)1, (short)1);
            var tuple6 = (1, (byte)1, (sbyte)1, (uint)1, (short)1, 1f);
            var tuple7 = (1, (byte)1, (sbyte)1, (uint)1, (short)1, 1f, 1d);
            var tuple8 = new ValueTuple <string, int, int, int, int, int, int, ValueTuple <int> >("test", 1, 1, 1, 1, 1, 1, tuple1);

            serializer1.Serialize(tuple1, buffer);
            serializer2.Serialize(tuple2, buffer);
            serializer3.Serialize(tuple3, buffer);
            serializer4.Serialize(tuple4, buffer);
            serializer5.Serialize(tuple5, buffer);
            serializer6.Serialize(tuple6, buffer);
            serializer7.Serialize(tuple7, buffer);
            serializer8.Serialize(tuple8, buffer);

            buffer.ResetPosition();
            Assert.Equal(tuple1, serializer1.Deserialize(buffer));
            Assert.Equal(tuple2, serializer2.Deserialize(buffer));
            Assert.Equal(tuple3, serializer3.Deserialize(buffer));
            Assert.Equal(tuple4, serializer4.Deserialize(buffer));
            Assert.Equal(tuple5, serializer5.Deserialize(buffer));
            Assert.Equal(tuple6, serializer6.Deserialize(buffer));
            Assert.Equal(tuple7, serializer7.Deserialize(buffer));
            Assert.Equal(tuple8, serializer8.Deserialize(buffer));
        }
Example #21
0
        public void UlongBoundaryTest()
        {
            var capacity = 9;

            using var buffer = new MessagePackBuffer(capacity);
            var serializer = MessagePackSerializersRepository.Get <ulong>();

            serializer.Serialize(ulong.MaxValue, buffer);
            Assert.Equal(buffer.Length, capacity);

            var data = buffer.GetAll();

            Assert.Equal(data[0], 207);
            Assert.Equal(data[1], 255);
            Assert.Equal(data[2], 255);
            Assert.Equal(data[3], 255);
            Assert.Equal(data[4], 255);
            Assert.Equal(data[5], 255);
            Assert.Equal(data[6], 255);
            Assert.Equal(data[7], 255);
            Assert.Equal(data[8], 255);
        }
Example #22
0
        public void ShortBoundaryTest()
        {
            var capacity = 6;

            using var buffer = new MessagePackBuffer(capacity);
            var serializer = MessagePackSerializersRepository.Get <short>();

            serializer.Serialize(short.MinValue, buffer);
            serializer.Serialize(short.MaxValue, buffer);

            Assert.Equal(buffer.Length, capacity);

            var firstValue = buffer.GetPart(0, 3);

            Assert.Equal(firstValue[0], 209);
            Assert.Equal(firstValue[1], 128);
            Assert.Equal(firstValue[2], 0);

            var secondValue = buffer.GetPart(3, 3);

            Assert.Equal(secondValue[0], 209);
            Assert.Equal(secondValue[1], 127);
            Assert.Equal(secondValue[2], 255);
        }
 public MessagePackSerializerValueTuple1()
 {
     _itemSerializer = MessagePackSerializersRepository.Get <T>();
 }
Example #24
0
 public DataResponse()
 {
     _dataSerializer = MessagePackSerializersRepository.Get <T>();
 }
Example #25
0
        public void FixNumsTest()
        {
            var capacity = 39;

            using var buffer = new MessagePackBuffer(capacity);

            var byteSerializer   = MessagePackSerializersRepository.Get <byte>();
            var sbyteSerializer  = MessagePackSerializersRepository.Get <sbyte>();
            var shortSerializer  = MessagePackSerializersRepository.Get <short>();
            var ushortSerializer = MessagePackSerializersRepository.Get <ushort>();
            var intSerializer    = MessagePackSerializersRepository.Get <int>();
            var uintSerializer   = MessagePackSerializersRepository.Get <uint>();
            var longSerializer   = MessagePackSerializersRepository.Get <long>();
            var ulongSerializer  = MessagePackSerializersRepository.Get <ulong>();

            byteSerializer.Serialize(0, buffer);
            sbyteSerializer.Serialize(0, buffer);
            shortSerializer.Serialize(0, buffer);
            ushortSerializer.Serialize(0, buffer);
            intSerializer.Serialize(0, buffer);
            uintSerializer.Serialize(0, buffer);
            longSerializer.Serialize(0, buffer);
            ulongSerializer.Serialize(0, buffer);

            byteSerializer.Serialize(64, buffer);
            sbyteSerializer.Serialize(64, buffer);
            shortSerializer.Serialize(64, buffer);
            ushortSerializer.Serialize(64, buffer);
            intSerializer.Serialize(64, buffer);
            uintSerializer.Serialize(64, buffer);
            longSerializer.Serialize(64, buffer);
            ulongSerializer.Serialize(64, buffer);

            byteSerializer.Serialize(127, buffer);
            sbyteSerializer.Serialize(127, buffer);
            shortSerializer.Serialize(127, buffer);
            ushortSerializer.Serialize(127, buffer);
            intSerializer.Serialize(127, buffer);
            uintSerializer.Serialize(127, buffer);
            longSerializer.Serialize(127, buffer);
            ulongSerializer.Serialize(127, buffer);

            sbyteSerializer.Serialize(-1, buffer);
            shortSerializer.Serialize(-1, buffer);
            intSerializer.Serialize(-1, buffer);
            longSerializer.Serialize(-1, buffer);

            sbyteSerializer.Serialize(-16, buffer);
            shortSerializer.Serialize(-16, buffer);
            intSerializer.Serialize(-16, buffer);
            longSerializer.Serialize(-16, buffer);

            sbyteSerializer.Serialize(-32, buffer);
            shortSerializer.Serialize(-32, buffer);
            intSerializer.Serialize(-32, buffer);
            longSerializer.Serialize(-32, buffer);

            longSerializer.Serialize(1, buffer);
            longSerializer.Serialize(-33, buffer);

            Assert.Equal(buffer.Length, capacity);

            var data0 = buffer.GetPart(0, 8);

            foreach (var value in data0)
            {
                Assert.Equal(value, 0x00);
            }

            var data64 = buffer.GetPart(8, 8);

            foreach (var value in data64)
            {
                Assert.Equal(value, 0x40);
            }

            var data127 = buffer.GetPart(16, 8);

            foreach (var value in data127)
            {
                Assert.Equal(value, 0x7f);
            }

            var dataNegative1 = buffer.GetPart(24, 4);

            foreach (var value in dataNegative1)
            {
                Assert.Equal(value, 0xff);
            }

            var dataNegative16 = buffer.GetPart(28, 4);

            foreach (var value in dataNegative16)
            {
                Assert.Equal(value, 0xf0);
            }

            var dataNegative32 = buffer.GetPart(32, 4);

            foreach (var value in dataNegative32)
            {
                Assert.Equal(value, 0xe0);
            }

            var outOfBoundsValues = buffer.GetPart(36, 3);

            Assert.Equal(outOfBoundsValues[0], 1);
            Assert.Equal(outOfBoundsValues[1], 208);
            Assert.Equal(outOfBoundsValues[2], 223);
        }
 public MessagePackSerializerList()
 {
     _elementSerializer = MessagePackSerializersRepository.Get <T>();
 }
 public MessagePackSerializerDictionary()
 {
     _keySerializer   = MessagePackSerializersRepository.Get <TKey>();
     _valueSerializer = MessagePackSerializersRepository.Get <TValue>();
 }
        public void Setup()
        {
            var size = 100000;

            _shortString   = new string(new char[10]);
            _averageString = new string(new char[10000]);
            _largeString   = new string(new char[int.MaxValue / 10]);
            _tuple         = (int.MaxValue, double.MaxValue, int.MaxValue);
            _intArray      = new int[size];

            _tuples = new List <TupleData>(size);
            for (var i = 0; i < size; i++)
            {
                var tuple = new TupleData(Int32.MaxValue - i, double.MaxValue - i, long.MaxValue - 1);
                _tuples.Add(tuple);
            }

            _serializerIntCli        = MessagePackSerializer.Get <int>();
            _serializerDoubleCli     = MessagePackSerializer.Get <double>();
            _serializerFloatCli      = MessagePackSerializer.Get <float>();
            _serializerStringCli     = MessagePackSerializer.Get <string>();
            _serializerArrayIntCli   = MessagePackSerializer.Get <int[]>();
            _serializerTupleArrayCli = MessagePackSerializer.Get <List <TupleData> >();
            _serializerTupleCli      = MessagePackSerializer.Get <TupleData>();

            _serializerIntSekougi        = MessagePackSerializersRepository.Get <int>();
            _serializerDoubleSekougi     = MessagePackSerializersRepository.Get <double>();
            _serializerFloatSekougi      = MessagePackSerializersRepository.Get <float>();
            _serializerStringSekougi     = MessagePackSerializersRepository.Get <string>();
            _serializerArrayIntSekougi   = MessagePackSerializersRepository.Get <int[]>();
            _serializerTupleArraySekougi = MessagePackSerializersRepository.Get <List <TupleData> >();
            _serializerTupleSekougi      = MessagePackSerializersRepository.Get <TupleData>();

            var stringToSerialize   = new string(new char[size]);
            var intArrayToSerialize = new int[size];

            _streamCliTuple = new MemoryStream();
            _serializerTupleCli.Pack(_streamCliTuple, _tuple);

            _streamCliInt = new MemoryStream();
            _serializerIntCli.Pack(_streamCliInt, int.MaxValue);

            _streamCliFloat = new MemoryStream();
            _serializerFloatCli.Pack(_streamCliFloat, float.MaxValue);

            _streamCliString = new MemoryStream();
            _serializerStringCli.Pack(_streamCliString, new string(stringToSerialize));

            _streamCliArrayInt = new MemoryStream();
            _serializerArrayIntCli.Pack(_streamCliArrayInt, intArrayToSerialize);


            _sekougiDeserializationBufferIntArray = new MessagePackBuffer();
            var writer = new MessagePackWriter(_sekougiDeserializationBufferIntArray);

            _serializerArrayIntSekougi.Serialize(intArrayToSerialize, writer);

            _sekougiDeserializationBufferTuple = new MessagePackBuffer();
            writer = new MessagePackWriter(_sekougiDeserializationBufferTuple);
            _serializerTupleSekougi.Serialize(_tuple, writer);

            _sekougiDeserializationBufferInt = new MessagePackBuffer();
            writer = new MessagePackWriter(_sekougiDeserializationBufferInt);
            _serializerIntSekougi.Serialize(int.MaxValue, writer);

            _sekougiDeserializationBufferFloat = new MessagePackBuffer();
            writer = new MessagePackWriter(_sekougiDeserializationBufferFloat);
            _serializerFloatSekougi.Serialize(float.MaxValue, writer);

            _sekougiDeserializationBufferString = new MessagePackBuffer();
            writer = new MessagePackWriter(_sekougiDeserializationBufferString);
            _serializerStringSekougi.Serialize(new string(stringToSerialize), writer);
        }