From 7691f63d2919f386ae3d426b7a0d0c07b07e923a Mon Sep 17 00:00:00 2001 From: Graham Date: Tue, 19 Jan 2021 18:29:33 +0000 Subject: [PATCH] Make Js5Response extend DefaultByteBufHolder This is possible now it is no longer a subclass of a sealed class. Signed-off-by: Graham --- .../org/openrs2/protocol/js5/Js5Response.kt | 36 ++----------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/protocol/src/main/kotlin/org/openrs2/protocol/js5/Js5Response.kt b/protocol/src/main/kotlin/org/openrs2/protocol/js5/Js5Response.kt index a536cec6..e9f75e22 100644 --- a/protocol/src/main/kotlin/org/openrs2/protocol/js5/Js5Response.kt +++ b/protocol/src/main/kotlin/org/openrs2/protocol/js5/Js5Response.kt @@ -1,43 +1,11 @@ package org.openrs2.protocol.js5 import io.netty.buffer.ByteBuf -import io.netty.util.ReferenceCounted +import io.netty.buffer.DefaultByteBufHolder public data class Js5Response( public val prefetch: Boolean, public val archive: Int, public val group: Int, public val data: ByteBuf -) : ReferenceCounted { - override fun refCnt(): Int { - return data.refCnt() - } - - override fun retain(): Js5Response { - data.retain() - return this - } - - override fun retain(increment: Int): Js5Response { - data.retain(increment) - return this - } - - override fun touch(): Js5Response { - data.touch() - return this - } - - override fun touch(hint: Any?): Js5Response { - data.touch(hint) - return this - } - - override fun release(): Boolean { - return data.release() - } - - override fun release(decrement: Int): Boolean { - return data.release(decrement) - } -} +) : DefaultByteBufHolder(data)