WordProcessor
1.0.0indexedRenders JSON data as a collapsible, syntax‑colored tree with expandable objects/arrays, type‑based coloring, indentation via CompositionLocal, and configurable styling for spacing, colors, and counts.
Renders JSON data as a collapsible, syntax‑colored tree with expandable objects/arrays, type‑based coloring, indentation via CompositionLocal, and configurable styling for spacing, colors, and counts.
WordProcessor is a Kotlin Multiplatform library that provides low‑level word‑oriented byte processing, message holders, and streaming reassembly utilities for binary protocols.
It focuses on:
This repository contains:
core/ – the WordProcessor core librarysample/ – a small multiplatform sample app (work in progress)Artifacts are published as WordProcessor Core to Maven Central.
Gradle (Kotlin DSL):
dependencies {
implementation("net.tactware.wordprocessor:core:1.0.0")
}
Make sure you have Maven Central enabled:
repositories {
mavenCentral()
}
WordProcessorimport net.tactware.wordprocessor.core.ByteOrder
import net.tactware.wordprocessor.core.WordProcessorFactory
import net.tactware.wordprocessor.core.WordSize
val processor = WordProcessorFactory.create(
wordSize = WordSize.WORD_32,
byteOrder = ByteOrder.BIG_ENDIAN
)
val bytes: ByteArray = /* incoming data */
require(processor.validate(bytes))
val words: List<Long> = processor.extractWords(bytes)
MessageReassemblerimport net.tactware.wordprocessor.reassembler.MessageReassembler
import net.tactware.wordprocessor.reassembler.MessageReassemblerFactory
val reassembler: MessageReassembler =
MessageReassemblerFactory.fixedSize(
expectedWordCount = 8, // example
wordSize = WordSize.WORD_32,
byteOrder = ByteOrder.BIG_ENDIAN
)
incomingChunks.forEach { chunk ->
val messages = reassembler.feed(chunk)
messages.forEach { message ->
// handle complete message
}
}
Refer to the core/src/commonMain/kotlin/net/tactware/wordprocessor package for more details on available processors, handlers, and message types.
./gradlew build
./gradlew test
Open the project in IntelliJ IDEA or Android Studio for best Kotlin Multiplatform support.
Kotlin and Gradle versions are controlled via:
gradle/libs.versions.tomlgradle.propertiesUnless otherwise specified, this project is provided under the license declared in the repository root (for example, Apache‑2.0 as used in published artifacts).
commonMain logic shared across targetsWordProcessor interface with configurable WordSize and ByteOrderLongProtocolHandler and implementations for raw and standard processingMessage, WordHolder, etc.) for representing packets/framesMessageReassembler and implementations for feeding byte streamsMessage instancescore:
core/ – core word processing interfaces and factories (WordProcessor, WordProcessorFactory, WordSize, ByteOrder)bits/ – bit‑level extraction and manipulation helpersholder/ – message and word holder abstractionsimpl/ – concrete WordProcessor implementations (16/32/64‑bit)protocol/ – protocol handler abstractions and implementationsreassembler/ – message reassembly APIs and implementationssample:
Surfaced from shared tags and platforms — no rankings paid for.