This commit is contained in:
Him188 2020-04-17 10:40:39 +08:00
parent 6d57f44e91
commit 47a288c614
2 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ internal object HighwayHelper {
val headLength = readInt()
discardExact(4)
val proto = readProtoBuf(CSDataHighwayHead.RspDataHighwayHead.serializer(), length = headLength)
check(proto.errorCode == 0) { "image upload failed: Transfer errno=${proto.errorCode}" }
check(proto.errorCode == 0) { "highway transfer failed, error ${proto.errorCode}" }
}
}
}

View File

@ -94,7 +94,7 @@ internal fun UByteArray.toUHexString(separator: String = " ", offset: Int = 0, l
@Suppress("NOTHING_TO_INLINE")
internal inline fun ByteArray.encodeToString(offset: Int = 0, charset: Charset = Charsets.UTF_8): String =
String(this, charset = charset, offset = offset)
String(this, charset = charset, offset = offset, length = this.size - offset)
@PublishedApi
internal inline fun ByteArray.toReadPacket(offset: Int = 0, length: Int = this.size - offset) =