I have a struct with a BufStream<T>
where T: Read+Write
.
The BufStream
can be a TcpStream
and I'd like to read n bytes from it.
Not a fixed amount of bytes in a predefined buffer, but I have a string/stream which indicates the number of bytes to read next.
Is there a nice way to do that?
See Question&Answers more detail:os