예제 #1
0
 public MemoryStore(NetworkParameters parameters)
     : base(parameters)
 {
     locker=new ReaderWriterLockDisposable();
     using(locker.AcquireWriterLock())
     { store=new Dictionary<string,StoredBlock>(); }
 }
예제 #2
0
        //TODO: Overflow MUST increment the stream length in order to be usable
        public ByteStreamUnsafe(int streamLength)
        {
            locker = new ReaderWriterLockDisposable();

            using (locker.AcquireWriterLock())
            {
                Position = 0;
                Stream   = new byte[streamLength];
            }
        }
예제 #3
0
        //TODO: Overflow MUST increment the stream length in order to be usable
        public ByteStreamUnsafe(int streamLength)
        {
            locker=new ReaderWriterLockDisposable();

            using(locker.AcquireWriterLock())
            {
                Position=0;
                Stream=new byte[streamLength];
            }
        }
예제 #4
0
 public override void SetLength(long value)
 {
     using (locker.AcquireWriterLock())
     { Array.Resize(ref Stream, (int)value); }
 }