I would like to set a generic value (n) in the array based on the bytes that are written in the stream. Now I do not know the exact length of the buffer, I just create a hard coded array to read the stream bytes.
use mio::net::TcpStream;
...
let mut buf = [0;12];
stream.read_exact(&mut buf).unwrap();
I would like to swap the 12 hard coded length for a bytes length (n), any clues?