public override void Read(Span <byte> buffer) { for (int i = 0; i < buffer.Length && DataToRead.Count > 0; i++) { buffer[i] = DataToRead.Dequeue(); } }
public override byte ReadByte() { if (DataToRead.Count == 0) { throw new InvalidOperationException("No data to read available"); } return(DataToRead.Dequeue()); }