Exemplo n.º 1
0
 public void ReadEnd()
 {
     readBuffer.Clear();
     midBuffer  = readBuffer;
     readBuffer = null;
     readEnd.Release();
 }
Exemplo n.º 2
0
 public ByteSpan SwapBegin()
 {
     readEnd.WaitOne();
     readBuffer  = writeBuffer;
     writeBuffer = midBuffer;
     midBuffer   = null;
     return(writeBuffer);
 }
Exemplo n.º 3
0
 public DoubleBuffer(byte[] readBuffer, byte[] writeBuffer, Action onReadBufferReady)
 {
     this.onReadBufferReady = onReadBufferReady;
     this.midBuffer         = new ByteSpan(readBuffer);
     this.writeBuffer       = new ByteSpan(writeBuffer);
 }