We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5dfb93d commit 9189539Copy full SHA for 9189539
src/network/stream_reader.rs
@@ -23,14 +23,14 @@
23
//!
24
25
use core::fmt;
26
-use io::Read;
+use io::{Read, BufReader};
27
28
use consensus::{encode, Decodable};
29
30
/// Struct used to configure stream reader function
31
pub struct StreamReader<R: Read> {
32
/// Stream to read from
33
- pub stream: R,
+ pub stream: BufReader<R>,
34
}
35
36
impl<R: Read> fmt::Debug for StreamReader<R> {
@@ -44,7 +44,7 @@ impl<R: Read> StreamReader<R> {
44
#[deprecated(since="0.28.0", note="wrap you stream into a buffered reader if necessary and use consensus_encode directly")]
45
pub fn new(stream: R, _buffer_size: Option<usize>) -> StreamReader<R> {
46
StreamReader {
47
- stream,
+ stream: BufReader::new(stream),
48
49
50
0 commit comments