fixed memory leak in InMemoryCache

This commit is contained in:
2025-02-05 19:09:51 +08:00
parent 1b6cf1bd96
commit 7d0f24fa58
7 changed files with 125 additions and 37 deletions

View File

@@ -0,0 +1,19 @@
package net.woggioni.gbcs.common
import io.netty.buffer.ByteBuf
import java.io.InputStream
import java.io.OutputStream
class ByteBufOutputStream(private val buf : ByteBuf) : OutputStream() {
override fun write(b: Int) {
buf.writeByte(b)
}
override fun write(b: ByteArray, off: Int, len: Int) {
buf.writeBytes(b, off, len)
}
override fun close() {
buf.release()
}
}