diff --git a/cache/src/main/java/dev/openrs2/cache/BufferedFileChannel.kt b/cache/src/main/java/dev/openrs2/cache/BufferedFileChannel.kt index c6010163..ecb95698 100644 --- a/cache/src/main/java/dev/openrs2/cache/BufferedFileChannel.kt +++ b/cache/src/main/java/dev/openrs2/cache/BufferedFileChannel.kt @@ -24,6 +24,8 @@ public class BufferedFileChannel( private var writePos = -1L init { + require(readBufferSize >= 0 && writeBufferSize >= 0) + val buf = alloc.buffer(readBufferSize, readBufferSize) try { writeBuffer = alloc.buffer(writeBufferSize, writeBufferSize)