コード例 #1
0
        private MemoryStream PrepareMsgPack(BeerListSerializeBenchmark serializer)
        {
            var memoryStream = new MemoryStream();

            serializer.MsgPackSerialize(memoryStream);
            return(memoryStream);
        }
コード例 #2
0
        private MemoryStream PrepareJson(BeerListSerializeBenchmark serializer)
        {
            var memoryStream = new MemoryStream();

            serializer.JsonSerialize(memoryStream);
            return(memoryStream);
        }
コード例 #3
0
        public BeerListDeserializeBenchmark()
        {
            var serializer = new BeerListSerializeBenchmark();

            _json         = PrepareJson(serializer);
            _msgPack      = PrepareMsgPack(serializer);
            _msgPackArray = _msgPack.ToArray();
        }
コード例 #4
0
        public BeerSkipList()
        {
            var serialize = new BeerListSerializeBenchmark();

            _inputStream = PrepareMsgPack(serialize);
            _inputBytes  = _inputStream.ToArray();

            _unpacker = Unpacker.Create(_inputStream);

            _msgPackContext = new MsgPackContext();
            _msgPackContext.RegisterConverter(new SkipConverter <Beer>());
        }