예제 #1
0
 public void Initialize()
 {
     _data              = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 115 };
     _pooledArray       = new byte[4];
     _byteArrayPool     = new MockByteArrayPool(_pooledArray);
     _is                = new MemoryStream(_data);
     _os                = new MemoryStream();
     _pooledByteStreams = new PooledByteStreams(_byteArrayPool, POOLED_ARRAY_SIZE);
 }
예제 #2
0
        public void Initialize()
        {
            _data  = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
            _pool  = new FakeNativeMemoryChunkPool();
            _stats = new PoolStats <NativeMemoryChunk>(_pool);

            byte[]            pooledByteArray = new byte[8];
            MockByteArrayPool byteArrayPool   = new MockByteArrayPool(pooledByteArray);

            _pooledByteStreams = new PooledByteStreams(byteArrayPool, 8);
            _factory           = new NativePooledByteBufferFactory(_pool, _pooledByteStreams);
        }