HomeSerpent OS

binary/writer: Reimplement WriterToken as a contractual interface

Description

binary/writer: Reimplement WriterToken as a contractual interface

We now allow encoding directly to a file, which saves on many, many
in memory copies. To permit this, a WriterToken implementation is
in place that allows writing a temporary "dumb" (corrupt) header to
the stream.

Once all payload encoding is complete, we rewind to the first payload
in the file and begin emitting the corrected payload headers with all
the right information (size/ compression / etc).

Right now we only support basic PlainWriterToken but we'll quickly
restore zlib + zstd.

Signed-off-by: Ikey Doherty <ikey@serpentos.com>

Details

Provenance
ikeyAuthored on Mon, Feb 22, 10:44 PM
Parents
rMFM069872f86f7d: binary/writer: Remove unused imports
Branches
Unknown
Tags
Unknown