Add boolean to optionally decompress with version header
Mostly will be used for testing
This commit is contained in:
parent
5472d418f5
commit
5e770a0f2c
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasVersionHeader) {
|
||||||
buffer.getShort() // Version - may be used in the future
|
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()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user