update buffers

This commit is contained in:
tursom 2021-07-14 10:13:36 +08:00
parent 6f8b21312f
commit bf98749f44

View File

@ -53,8 +53,12 @@ open class ListByteBuffer(
override fun writeBuffer(): java.nio.ByteBuffer = throw UnsupportedOperationException()
override fun append(buffer: ByteBuffer) {
val bufReadPosition = buffer.readPosition
val bufWritePosition = buffer.writePosition
buffers.add(buffer)
buffersArrayCache = null
readPosition += bufReadPosition
writePosition += bufWritePosition
}
override fun slice(position: Int, size: Int, readPosition: Int, writePosition: Int): ByteBuffer =