Skip to content

cobs_codec 1.1.0

Choose a tag to compare

@github-actions github-actions released this 04 Jul 16:08
v1.1.0
904d80a

cobs_codec 1.1.0 (Kotlin / Android)

Three new capabilities for the pure-Kotlin COBS / COBS-R library — all additive and backward compatible (existing 1.0.0 signatures are untouched), and byte-identical to the Rust and Dart members of the Firechip COBS family.

The Maven artifact is dev.firechip:cobs_codec; the _kt suffix is only the repository slug.

✨ New features

Configurable sentinelCobs/Cobsr.encodeWithSentinel / decodeWithSentinel frame on any delimiter byte instead of 0x00; the encoded output never contains the sentinel byte. sentinel == 0 is byte-for-byte identical to the plain codec.

val s = 0xAA.toByte()
val stuffed = Cobs.encodeWithSentinel(byteArrayOf(0x11, 0x00, 0x22), s) // [0xA8,0xBB,0xA8,0x88] — no 0xAA
Cobs.decodeWithSentinel(stuffed, s)                                     // [0x11,0x00,0x22]

In-place decode (basic COBS) — Cobs.decodeInPlace(buffer) decodes within the same ByteArray with no second allocation and returns the decoded length.

Sentinel-aware framingCobsFraming.frame / unframe and the CobsStreamDecoder constructor each take a trailing sentinel: Byte = COBS_DELIMITER, so a whole link can be delimited by any chosen byte.

📦 Install

GitHub Packages Maven (needs a read:packages token):

implementation("dev.firechip:cobs_codec:1.1.0")

Or download the attached cobs_codec-1.1.0.aar and drop it into libs/ — no authentication required.

✅ Verified

Android lint + JUnit unit tests green; conformance vectors byte-identical to the shared suite; the XOR-based sentinel encoding is byte-identical to the Rust and Dart siblings.