diff --git a/protobuf/src/coded_output_stream/mod.rs b/protobuf/src/coded_output_stream/mod.rs index 26293399f..71ce1568a 100644 --- a/protobuf/src/coded_output_stream/mod.rs +++ b/protobuf/src/coded_output_stream/mod.rs @@ -244,6 +244,7 @@ impl<'a> CodedOutputStream<'a> { } OutputTarget::Write(ref mut write, _) => { write.write_all(bytes)?; + self.pos_of_buffer_start += bytes.len() as u64; } OutputTarget::Vec(ref mut vec) => { assert!(self.buffer.pos_within_buf() == 0);