Fix build

This commit is contained in:
Him188 2020-01-31 17:52:28 +08:00
parent 85b72ac4b8
commit b85c91b25d

View File

@ -502,18 +502,17 @@ class Jce private constructor(private val charset: JceCharset, context: SerialMo
internal val leastRemaining = input.remaining - maxReadSize internal val leastRemaining = input.remaining - maxReadSize
internal val isEndOfInput: Boolean get() = input.remaining <= leastRemaining internal val isEndOfInput: Boolean get() = input.remaining <= leastRemaining
internal var currentJceHead: JceHead? = input.doReadHead().also { internal var currentJceHead: JceHead? = input.doReadHead()
// println("first jce head = $it") }
override fun close() = input.close() override fun close() = input.close()
internal fun peakHeadOrNull(): JceHead? = currentJceHead ?: readHeadOrNull() internal fun peakHeadOrNull(): JceHead? = currentJceHead ?: readHeadOrNull()
internal fun peakHead(): JceHead = peakHeadOrNull() ?: error("no enough data to read head") internal fun peakHead(): JceHead = peakHeadOrNull() ?: error("no enough data to read head")
@PublishedApi @PublishedApi
internal fun readHead(): JceHead = readHeadOrNull() ?: error("no enough data to read head") internal fun readHead(): JceHead = readHeadOrNull() ?: error("no enough data to read head")
@PublishedApi @PublishedApi
internal fun readHeadOrNull(): JceHead? = input.doReadHead() internal fun readHeadOrNull(): JceHead? = input.doReadHead()
/** /**
@ -597,10 +596,9 @@ class Jce private constructor(private val charset: JceCharset, context: SerialMo
val head = readHead() val head = readHead()
readHead() readHead()
check(head.type.toInt() == 0) { "type mismatch" } check(head.type.toInt() == 0) { "type mismatch" }
input.readBytes(readInt(0).also { input.readBytes(readInt(0))
// println("list size=$it") }) }
} else -> error("type mismatch")
else -> error("type mismatch")
} }
} }