From c44e9fca3efa0aad31502a39ef476ed7f40d8405 Mon Sep 17 00:00:00 2001 From: tursom Date: Tue, 25 Aug 2020 17:28:07 +0800 Subject: [PATCH] fix bug --- .../kotlin/cn/tursom/core/buffer/ByteBufferExtension.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/cn/tursom/core/buffer/ByteBufferExtension.kt b/src/main/kotlin/cn/tursom/core/buffer/ByteBufferExtension.kt index 0d43b81..32bda8f 100644 --- a/src/main/kotlin/cn/tursom/core/buffer/ByteBufferExtension.kt +++ b/src/main/kotlin/cn/tursom/core/buffer/ByteBufferExtension.kt @@ -7,7 +7,10 @@ package cn.tursom.core.buffer import cn.tursom.buffer.MultipleByteBuffer import cn.tursom.core.buffer.impl.ArrayByteBuffer -import java.nio.channels.* +import java.nio.channels.GatheringByteChannel +import java.nio.channels.ReadableByteChannel +import java.nio.channels.ScatteringByteChannel +import java.nio.channels.WritableByteChannel /** @@ -99,7 +102,7 @@ fun ScatteringByteChannel.read(buffers: Array): Long { it.finishWrite(bufferArray[index]) } } else { - it.finishRead(bufferArray[index]) + it.finishWrite(bufferArray[index]) } } index++