mp_bintools/docs/bipack.md
2023-03-15 23:03:45 +01:00

1.1 KiB

Module mp_bintools

This library contains a Bipack binary format serializer, see [net.sergeych.bipack.BipackEncoder] and [net.sergeych.bipack.BipackDecoder]. Also, there are many general-purpose utilities that simplify binary data processing, see package [net.sergeych.bintools] below.

Package net.sergeych.bipack

Bipack ais a common kotlinx serializer that works pretty much like any other kotlinx.serialization format. You just mark your class as @Serializable and it does the rest.

  • [BipackEncoder] to serializes anything to bipack format.
  • [BpackDecoder] deserializes from bipack back.

There are also special annotation to fine tune the format: [Extendable], [Framed], [CrcProtected] for classes and [Unsigned] for integer data fields.

Package net.sergeych.bintools

General-purpose binary tools: encoding to bytes, hex, binary dumps. variable length integer, ect. Most of it is used internally by bipack serializers, see [net.sergeych.bipack] for details.

In particular, see [Varint] and [Smartint] variable-length compact integer codecs and also [DataSource] and [DataSink] multiplatform synchronous read/write interfaces.