I am having some hard time understanding how to work with streams in C#.
I plan to have a class of this form:
class Pipe {
public void PutChar(char c) { ... }
public char GetChar() { ... }
}
The idea is that one thread will put chars in this Pipe
through its PutChar()
method, and later on other thread will make use of GetChar()
to get the chars that are in Pipe
.
In Java I'd make use of PipedReader
and PipedWriter
classes. There seem to be no equivalent classes in C#, so which (stream?) classes should I use here? Or aren't streams the correct way of implementing this? Maybe I'd be better off using a Queue
, instead?
Thanks