public List <object> Dequeue(int n) { lock (this.SyObject) { UpdateState(); List <object> R = new List <object>(n); int Index = 0; while (true) { var tmp = dataFile.ReadBinaryEntry(); if (tmp == null) { return(R); } R.Add(Deserialize(tmp.Value)); ++Index; realCurrent++; realCursor = (int)dataFile.Position; if (Index == n) { break; } } return(R); } }
public List <object> ShadowDequeueAll() { lock (this.SyObject) { List <object> R = new List <object>(); using (var tmpFile = new StreamRW(FileName)) { tmpFile.Seek(12, SeekOrigin.Begin); while (true) { var E = tmpFile.ReadBinaryEntry(); if (E == null) { return(R); } R.Add(Deserialize(E.Value)); } return(R); } } }