Skip to content

Commit

Permalink
add Encoder::flush and Encoder::into_inner
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw committed Nov 2, 2024
1 parent 171ba3f commit 6992473
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,16 @@ impl<W: Write> Encoder<W> {
self.writer.write_all(frame.get_v_plane())?;
Ok(())
}

/// Flush the underlying writer.
pub fn flush(&mut self) -> Result<(), Error> {
self.writer.flush().map_err(|e| Error::IoError(e))
}

/// Return the underlying writer.
pub fn into_inner(self) -> W {
self.writer
}
}

/// Create a new decoder instance. Alias for `Decoder::new`.
Expand Down

0 comments on commit 6992473

Please sign in to comment.