Avoid write() calls with a length of zero

bzip2
Graham 5 years ago
parent 8d90a70b6a
commit e480ce282a
  1. 2
      common/src/main/java/dev/openrs2/common/io/SkipOutputStream.kt

@ -12,7 +12,7 @@ class SkipOutputStream(private val out: OutputStream, private var skipBytes: Lon
} }
override fun write(b: ByteArray, off: Int, len: Int) { override fun write(b: ByteArray, off: Int, len: Int) {
if (len >= skipBytes) { if (len > skipBytes) {
out.write(b, off + skipBytes.toInt(), len - skipBytes.toInt()) out.write(b, off + skipBytes.toInt(), len - skipBytes.toInt())
skipBytes = 0 skipBytes = 0
} else { } else {

Loading…
Cancel
Save