Bodu.IO.Biff guides
Recipe-style walk-throughs for Bodu.IO.Biff, the low-level codec for the BIFF5 and BIFF8 record streams inside legacy .xls workbooks. The package frames records, establishes the version and code page, decodes the common records through typed accessors, walks the shared string table across its CONTINUE records, and writes records back, in either version.
The library has no workbook model: it knows how BIFF is encoded, not what a workbook means. The reader in Bodu.Formats.Excel.Binary is built on it - the same codec/format split as Bodu.IO.Pst beneath Bodu.Formats.Outlook.Pst - and the container around the record stream is Bodu.IO.Compound.
If you are new to the library, start with the introduction, the Core concepts glossary, and the getting-started page, which cover reading a whole stream, decoding records, the shared string table, and writing single records. The guides below take each direction further.
How the library works
A workbook stream is a flat sequence of records - a two-byte identifier, a two-byte length, and a payload - grouped into substreams, each opened by a BOF record and closed by an EOF record: the workbook globals first, then one per sheet. BiffReader is a ref struct that walks the sequence forward over a span you supply, one physical record at a time, allocating nothing; the only state it keeps is the version and the code page, which it can hand to a reader over the next block. BiffWriter emits records to an IBufferWriter<byte> under one version, and leaves their order, and the offsets the globals record, to you.
Namespace map
| Namespace | What lives here | Guides |
|---|---|---|
| Bodu.IO.Biff | BiffReader with BiffReaderOptions and BiffReaderState; BiffSstReader; BiffWriter with BiffWriterOptions; the decoded Biff*Record types; BiffString, BiffRk, BiffRecordHeader, BiffLimits; the vocabulary enumerations; and the BiffFormatException / BiffUnsupportedVersionException pair. |
Authoring a workbook stream · Reading a stream a block at a time |
Guides
Authoring a workbook stream
Assemble a complete BIFF8 workbook stream - globals, sheet substreams, BOUNDSHEET offsets, and a shared string table split into CONTINUE records - store it in a compound file, read it back, and see what changes under BIFF5.
Reading a stream a block at a time
Read any stream, seekable or not, one buffer at a time with BiffReaderState and BytesConsumed; keep the shared string table whole across blocks; and read one sheet with the state the globals established.
Reading workbooks
The spreadsheet reader built on this package: sheets, cells by position, number formats, and dates, from a whole .xls file.
Suggested reading path
- Getting started - reading, decoding, and writing single records.
- Authoring a workbook stream - when you produce
.xlsdata rather than only read it. - Reading a stream a block at a time - when the stream is large, arrives in pieces, or cannot seek.
Where to go next
- Runnable sample - the
BiffBasicsconsole project undersamples/IO.Biff/. - Bodu.IO.Biff API reference - every type and member.
- Record reference - every record the codec decodes and writes, by version.
- Package matrix - where Bodu.IO.Biff sits in the suite and its dependency stack.