Add BufferModule for injecting ByteBufAllocator

Signed-off-by: Graham <gpe@openrs2.dev>
Graham 4 years ago
parent 006b4ff5bc
commit 2482e20063
  1. 1
      buffer/build.gradle.kts
  2. 12
      buffer/src/main/java/dev/openrs2/buffer/BufferModule.kt

@ -4,6 +4,7 @@ plugins {
} }
dependencies { dependencies {
api("com.google.inject:guice:${Versions.guice}")
api("io.netty:netty-buffer:${Versions.netty}") api("io.netty:netty-buffer:${Versions.netty}")
implementation("com.google.guava:guava:${Versions.guava}") implementation("com.google.guava:guava:${Versions.guava}")

@ -0,0 +1,12 @@
package dev.openrs2.buffer
import com.google.inject.AbstractModule
import io.netty.buffer.ByteBufAllocator
import io.netty.buffer.PooledByteBufAllocator
public object BufferModule : AbstractModule() {
override fun configure() {
bind(ByteBufAllocator::class.java)
.toInstance(PooledByteBufAllocator.DEFAULT)
}
}
Loading…
Cancel
Save