public bool TryEnqueue(KeyValuePair <int, byte[]> item) { if (CanEnqueue()) { QueueOfBlocks.Enqueue(item); QueueIsActivate = true; return(true); } return(false); }
public KeyValuePair <int, byte[]> Dequeue() { lock (_lock) { if (CanDequeue()) { return(QueueOfBlocks.Dequeue()); } throw new EndQueueException(); } }