Commit c09a60d3 authored by Him188's avatar Him188

Add debugging functions

parent d6c9b935
...@@ -24,6 +24,13 @@ internal fun IoBuffer.debugPrint(name: String): IoBuffer { ...@@ -24,6 +24,13 @@ internal fun IoBuffer.debugPrint(name: String): IoBuffer {
return readBytes.toIoBuffer() return readBytes.toIoBuffer()
} }
@Deprecated("Low efficiency, only for debug purpose", ReplaceWith("this"))
internal inline fun IoBuffer.debugCopyUse(block: IoBuffer.() -> Unit): IoBuffer {
val readBytes = this.readBytes()
block(readBytes.toIoBuffer())
return readBytes.toIoBuffer()
}
@Deprecated("Low efficiency, only for debug purpose", ReplaceWith("discardExact(n)")) @Deprecated("Low efficiency, only for debug purpose", ReplaceWith("discardExact(n)"))
internal fun Input.debugDiscardExact(n: Number, name: String = "") { internal fun Input.debugDiscardExact(n: Number, name: String = "") {
DebugLogger.debug("Discarded($n) $name=" + this.readBytes(n.toInt()).toUHexString()) DebugLogger.debug("Discarded($n) $name=" + this.readBytes(n.toInt()).toUHexString())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment