pub fn feed<W: io::Write>(&mut self, mut byte: u8, writer: &mut W) -> io::Result<bool> {
        let mut i = 0;
        while i < 8 {
            match self.tree {
                HuffTree::Branch(left, right) => {
                    if byte & 1 == 0 {
                        self.tree = &left;
                    } else {
                        self.tree = &right;
                    }
                    byte >>= 1;
                    i += 1;
                }
                HuffTree::Known(byte) => {
                    writer.write_all(&[*byte])?;
                    self.tree = self.top_tree;
                }
                HuffTree::EOF => return Ok(false)
            }
        }
        Ok(true)
    }
/// Feed a byte to this reader
/// Return true if the reader can continue to accept input
Feed a byte to this reader
Return true if the reader can continue to accept input
Feed a byte to this reader Return true if the reader can continue to accept input
pub fn feed<W: io::Write>(&mut self, mut byte: u8, writer: &mut W) -> io::Result<bool> {
        let mut i = 0;
        while i < 8 {
            match self.tree {
                HuffTree::Branch(left, right) => {
                    if byte & 1 == 0 {
                        self.tree = &left;
                    } else {
                        self.tree = &right;
                    }
                    byte >>= 1;
                    i += 1;
                }
                HuffTree::Known(byte) => {
                    writer.write_all(&[*byte])?;
                    self.tree = self.top_tree;
                }
                HuffTree::EOF => return Ok(false)
            }
        }
        Ok(true)
    }
pub fn feed < W : io :: Write > ( & mut self , mut byte : u8 , writer : & mut W ) -> io :: Result < bool > { let mut i = 0 ; while i < 8 { match self . tree { HuffTree :: Branch ( left , right ) => { if byte & 1 == 0 { self . tree = & left ; } else { self . tree = & right ; } byte >>= 1 ; i += 1 ; } HuffTree :: Known ( byte ) => { writer . write_all ( & [ * byte ] ) ? ; self . tree = self . top_tree ; } HuffTree :: EOF => return Ok ( false ) } } Ok ( true ) }
Feed a byte to this reader
Return true if the reader can continue to accept input
Feed a byte to this reader Return true if the reader can continue to accept input
&mut self
byte
u8
writer
&mut W
&mut self
byte
u8
writer
&mut W