Set buffer size to 65,536 bytes

Although this is one byte larger than it needs to be to hold the largest
possible packet, I think using a power of two is nicer.
master
Graham 5 years ago
parent 1db43aef04
commit 250062a72f
  1. 4
      bundler/src/main/java/dev/openrs2/bundler/transform/BufferSizeTransformer.kt

@ -45,7 +45,7 @@ class BufferSizeTransformer : Transformer() {
NEW_BUFFER_MATCHER.match(method).forEach { NEW_BUFFER_MATCHER.match(method).forEach {
val putstatic = it[4] as FieldInsnNode val putstatic = it[4] as FieldInsnNode
if (MemberRef(putstatic) == buffer!!) { if (MemberRef(putstatic) == buffer!!) {
method.instructions[it[2]] = createIntConstant(65535) method.instructions[it[2]] = createIntConstant(65536)
buffersResized++ buffersResized++
} }
} }
@ -54,7 +54,7 @@ class BufferSizeTransformer : Transformer() {
} }
override fun postTransform(classPath: ClassPath) { override fun postTransform(classPath: ClassPath) {
logger.info { "Resized $buffersResized buffers to 65535 bytes" } logger.info { "Resized $buffersResized buffers to 65536 bytes" }
} }
companion object { companion object {

Loading…
Cancel
Save