pub struct LzfWriter<W: Write> { /* private fields */ }encoder only.Expand description
Framed LZF stream writer.
Writer that encodes framed LZF (ZV block stream).
Data written into this adapter is chunked into blocks and emitted as either
compressed or uncompressed ZV blocks.
Implementations§
Source§impl<W: Write> LzfWriter<W>
impl<W: Write> LzfWriter<W>
Sourcepub fn new(inner: W, block_size: usize) -> Result<Self>
pub fn new(inner: W, block_size: usize) -> Result<Self>
Creates a new framed LZF writer with the given block size (1..=65535).
Sourcepub fn new_with_mode(
inner: W,
block_size: usize,
mode: CompressionMode,
) -> Result<Self>
pub fn new_with_mode( inner: W, block_size: usize, mode: CompressionMode, ) -> Result<Self>
Creates a new framed LZF writer with an explicit compression mode.
Sourcepub fn new_with_eof_marker(inner: W, block_size: usize) -> Result<Self>
pub fn new_with_eof_marker(inner: W, block_size: usize) -> Result<Self>
Creates a writer and enables writing a trailing zero byte EOF marker on finish.
The marker matches the historical lzf utility stream behavior.
Sourcepub fn new_with_eof_marker_and_mode(
inner: W,
block_size: usize,
mode: CompressionMode,
) -> Result<Self>
pub fn new_with_eof_marker_and_mode( inner: W, block_size: usize, mode: CompressionMode, ) -> Result<Self>
Creates a writer and enables writing a trailing zero byte EOF marker on finish.
Compression mode is explicitly selected.
Sourcepub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Unwraps the writer and returns the underlying writer.
Sourcepub fn finish(self) -> Result<W>
pub fn finish(self) -> Result<W>
Finishes the stream and returns the underlying writer.
This flushes any pending input block. If EOF marker mode is enabled, a trailing zero byte is appended after the final block.
Sourcepub fn auto_finish(self) -> AutoFinisher<Self>
pub fn auto_finish(self) -> AutoFinisher<Self>
Returns a wrapper that will call finish() on drop.
This is useful for best-effort stream finalization in scopes with early returns.