Add boolean to optionally decompress with version header

Mostly will be used for testing
This commit is contained in:
Stedoss 2025-02-23 20:40:36 +00:00
parent 5472d418f5
commit 5e770a0f2c

View File

@ -44,7 +44,7 @@ fun wtcCompress(stream: String): ByteArray {
return byteStream.toByteArray() return byteStream.toByteArray()
} }
fun wtcDecompress(data: ByteArray): String { fun wtcDecompress(data: ByteArray, hasVersionHeader: Boolean = true): String {
val buffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN) val buffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN)
fun unpackBytes(): ByteArray { fun unpackBytes(): ByteArray {
@ -56,7 +56,10 @@ fun wtcDecompress(data: ByteArray): String {
return bytes return bytes
} }
buffer.getShort() // Version - may be used in the future if (hasVersionHeader) {
buffer.getShort() // Version - may be used in the future
}
val xs = unpackBytes() val xs = unpackBytes()
val ys = unpackBytes() val ys = unpackBytes()
val zs = unpackBytes() val zs = unpackBytes()