Bencode guides
Recipe-style walk-throughs for Bodu.Text.Bencode (BencodeSerializer). If you are new to the library, start with the introduction for the format specifics - byte strings, canonical ordering, the kinds Bencode cannot represent - and the core concepts for the three-tier mental model. The sibling TOML and YAML serializers share the same shape; see the family guide hub.
Using Bencode
The walk-through: round-tripping objects, the type mapping, a torrent-style worked example, canonical ordering, both DOMs, streams, and raw tokens.
Mapping attributes
Shaping the wire form declaratively - renaming, ignoring, ordering, required keys, constructors, extension data, and the precedence ladder.
Writing converters
BencodeConverter<T> - convert a type the defaults do not, register and resolve it, the enum converters, and failing clearly on malformed data.
Polymorphic converters
BencodeConverterFactory - open-generic families and tagged (discriminated) hierarchies selected by a "kind" field.
Serialization callbacks
The four shared IOnSerializing / IOnSerialized / IOnDeserializing / IOnDeserialized hooks - apply defaults, validate, derive state, and observe completed writes across the serialization lifecycle.
Built-in converter catalog
Every type Bencode handles without a user converter - its wire form, what the read path accepts, and the types that need a converter.
Where to go next
- Runnable samples - the offline torrent-file sample under
samples/Text.Bencode/: DOM inspection, canonical round trips, the raw-slice info-hash, and POCO mapping. - Bodu.Text.Bencode introduction - the format specifics behind these guides.
- Bodu serializer guides - the family hub, with the TOML and YAML guide sets.
- Text & Serialization guides - how these guides sit alongside the encoding and format guides.
- API reference - Bodu.Text.Bencode.