Skip to main content

StreamingDecoder

Trait StreamingDecoder 

Source
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§

Source

fn feed(&mut self, input: &[u8]) -> Result<(), DecodeError>

Feed a chunk of compressed input data.

Source

fn finish(&mut self) -> Result<(), DecodeError>

Signal that all input has been provided and perform final flush.

Source

fn output_available(&self) -> usize

Returns the number of decompressed bytes available to read.

Source

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.

Implementors§