pub struct RansDecoderStream<S: EncoderVariantForS> { /* private fields */ }Expand description
rANS decoder stream for a specific variant S.
Owns the encoded data and keeps a persistent decode cursor
(unit position + rANS state) across sequential decode calls.
This matches Microsoft’s RansDecoderStream, where the raw decoder
is initialized once in Open() and reused by every Decode call.
Implementations§
Source§impl<S: EncoderVariantForS> RansDecoderStream<S>
impl<S: EncoderVariantForS> RansDecoderStream<S>
Sourcepub fn check_eof(&self) -> bool
pub fn check_eof(&self) -> bool
Whether the current state can be at EOF.
EOF requires the source to be exhausted and the decoder state to be
at LowerBound (or the stream to be unopened).
Sourcepub fn decode_eof(&mut self) -> Result<(), EntropyError>
pub fn decode_eof(&mut self) -> Result<(), EntropyError>
Check that decoding reached the end of the message and close on success.
Sourcepub fn decode(
&mut self,
decoder: &EntropyDecoder<S>,
values: &mut [i32],
indices: &[i32],
) -> Result<(), EntropyError>
pub fn decode( &mut self, decoder: &EntropyDecoder<S>, values: &mut [i32], indices: &[i32], ) -> Result<(), EntropyError>
Decode a batch of symbols from the stream, advancing the persistent cursor.
The first call initializes the raw decoder from the stream’s initial state; subsequent calls continue from the saved cursor.
Sourcepub fn bytes_consumed(&self) -> usize
pub fn bytes_consumed(&self) -> usize
Number of bytes consumed so far (unit position × unit size).