13 lines
412 B
Kotlin
13 lines
412 B
Kotlin
package ru.dbotthepony.kstarbound.json
|
|
|
|
import com.google.gson.JsonElement
|
|
import ru.dbotthepony.kommons.io.readBinaryString
|
|
import java.io.DataInputStream
|
|
|
|
data class VersionedJson(val identifier: String, val version: Int?, val content: JsonElement) {
|
|
constructor(data: DataInputStream) : this(
|
|
data.readBinaryString(),
|
|
data.read().let { if (it > 0) data.readInt() else null },
|
|
data.readJsonElement())
|
|
}
|