Check {read,write}BufferSize are both zero or positive

Signed-off-by: Graham <gpe@openrs2.dev>
Graham 4 years ago
parent 5e447f31d6
commit 20d6d73d30
  1. 2
      cache/src/main/java/dev/openrs2/cache/BufferedFileChannel.kt

@ -24,6 +24,8 @@ public class BufferedFileChannel(
private var writePos = -1L private var writePos = -1L
init { init {
require(readBufferSize >= 0 && writeBufferSize >= 0)
val buf = alloc.buffer(readBufferSize, readBufferSize) val buf = alloc.buffer(readBufferSize, readBufferSize)
try { try {
writeBuffer = alloc.buffer(writeBufferSize, writeBufferSize) writeBuffer = alloc.buffer(writeBufferSize, writeBufferSize)

Loading…
Cancel
Save