diff --git a/src/main/kotlin/cn/tursom/core/buffer/ByteBuffer.kt b/src/main/kotlin/cn/tursom/core/buffer/ByteBuffer.kt index c58ac0f..4e223cc 100644 --- a/src/main/kotlin/cn/tursom/core/buffer/ByteBuffer.kt +++ b/src/main/kotlin/cn/tursom/core/buffer/ByteBuffer.kt @@ -99,7 +99,8 @@ interface ByteBuffer : Closeable { fun toString(size: Int): String { val bytes = getBytes(size) - readPosition += bytes.size + // 将测试的字节返还回来 + readPosition -= bytes.size return String(bytes) }