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