Package-level declarations
Bipack is 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.
BipackDecoder 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.
Types
Decode BiPack format. Note that it relies on DataSource so can throw DataSource.EndOfData excpetion. Specific frames when used can throw InvalidFrameException and its derivatives.e
Allow to CRC-protect structures (we suppose to use it with classes only). After the data block its CRC32 will be written and checked. It is memory-wise: it calculates CRC on the fly without buffering the data. If used with Framed and Extendable the extra data is protected too.
To be used with kotlinx.serialization.Serializable. Allows serialized classes to be extended by adding members with default initializers to the end of the constructor list.
Fixed-size number, big-endian. Could be used only with field of following types:
Serializable classes annotated as Framed will have leading checked mark as CRC32 of its name (uses @SerialName
internally). On deserializing, if frame will not match the expected name, the InvalidFrameException will be thrown.
Allow marking data fields as being serialized as unsigned (applicable also to signed fields lite Int, Long and Short, if you are sure they will not be negative). As unsigned types are not cully supported by kotlinx.serialization
it is the only way to tell the serialized to use more compact unsigned variable length encoding.