pub trait StreamingDecoder {
// Required methods
fn feed(&mut self, input: &[u8]) -> Result<(), DecodeError>;
fn finish(&mut self) -> Result<(), DecodeError>;
fn output_available(&self) -> usize;
fn read_output(&mut self, buf: &mut [u8]) -> usize;
}Expand description
A streaming (incremental) decoder for PDF stream data.
Callers feed input chunks via feed(),
then read available output via read_output().
Call finish() after all input is provided.
Required Methods§
Sourcefn feed(&mut self, input: &[u8]) -> Result<(), DecodeError>
fn feed(&mut self, input: &[u8]) -> Result<(), DecodeError>
Feed a chunk of compressed input data.
Sourcefn finish(&mut self) -> Result<(), DecodeError>
fn finish(&mut self) -> Result<(), DecodeError>
Signal that all input has been provided and perform final flush.
Sourcefn output_available(&self) -> usize
fn output_available(&self) -> usize
Returns the number of decompressed bytes available to read.
Sourcefn read_output(&mut self, buf: &mut [u8]) -> usize
fn read_output(&mut self, buf: &mut [u8]) -> usize
Read decompressed output into the provided buffer.
Returns the number of bytes actually written to buf.