Ejemplo n.º 1
0
 public MemoryStore(NetworkParameters parameters)
     : base(parameters)
 {
     locker=new ReaderWriterLockDisposable();
     using(locker.AcquireWriterLock())
     { store=new Dictionary<string,StoredBlock>(); }
 }
Ejemplo n.º 2
0
 protected override void Dispose(bool disposing)
 {
     using (locker.AcquireWriterLock())
     {
         base.Dispose(disposing);
         Stream = null;
         locker = null;
     }
 }
Ejemplo n.º 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];
            }
        }
Ejemplo n.º 4
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];
            }
        }
Ejemplo n.º 5
0
 protected override void Dispose(bool disposing)
 {
     using(locker.AcquireWriterLock())
     {
         base.Dispose(disposing);
         Stream=null;
         locker=null;
     }
 }