Blockbuster
0.1.0indexedEnables building serialization deserializers using callbacks for handling large JSON files. Supports lazy deserialization of complex structures and delegates to standard deserializers.
Enables building serialization deserializers using callbacks for handling large JSON files. Supports lazy deserialization of complex structures and delegates to standard deserializers.
Blockbuster is a multiplatform library to build Kotlin serialization deserializers that use callbacks. This can be used for example when deserializing large JSON files.
@Serializable/KSerializer deserializers.Kotlin serialization does not natively support deserializing huge files.
There is Json.decodeToSequence but that is only useful when
the JSON is just a plain array, and is completely specific to the JVM.
Blockbuster supports deserializing complex structures, where the parts specified are lazily deserialized.
Blockbuster is released under the terms of the MIT license.
val deserializer: DeserializationStrategy<Unit> = buildDeserializer {
field("description") { description: Text -> showText(description) }
objectField("table") {
arrayField("columnNames") { name: String -> addColumnName(name) }
arrayField("rows") { row: Row -> processRow(row) }
}
}
Json.decodeFromStream(deserializer, FileInputStream("huge-table.json"))
Surfaced from shared tags and platforms — no rankings paid for.