forked from openrs2/openrs2
Signed-off-by: Graham <gpe@openrs2.dev>
parent
0eda020092
commit
e0708458f9
@ -0,0 +1,25 @@ |
||||
plugins { |
||||
`maven-publish` |
||||
kotlin("jvm") |
||||
} |
||||
|
||||
dependencies { |
||||
api("io.netty:netty-buffer:${Versions.netty}") |
||||
} |
||||
|
||||
publishing { |
||||
publications.create<MavenPublication>("maven") { |
||||
from(components["java"]) |
||||
|
||||
pom { |
||||
packaging = "jar" |
||||
name.set("OpenRS2 Buffer") |
||||
description.set( |
||||
""" |
||||
Provides RuneScape-specific extension methods for Netty's |
||||
ByteBuf type. |
||||
""".trimIndent() |
||||
) |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,11 @@ |
||||
package dev.openrs2.buffer |
||||
|
||||
import io.netty.util.ReferenceCounted |
||||
|
||||
inline fun <T : ReferenceCounted, R> T.use(block: (T) -> R): R { |
||||
try { |
||||
return block(this) |
||||
} finally { |
||||
release() |
||||
} |
||||
} |
Loading…
Reference in new issue