pub fn write_all_counted<W: Write + ?Sized>( writer: &mut W, buffer: &[u8], codec: CodecKind, bytes_processed: usize, ) -> Result<(), CodecError>