What about flattening the `if` into the enclosing pattern match?

e.g.
````scala
case -1 => None
case `chunkSize` => Some(input)
case smallerRead =>
  val smallerBuffer = new Array[Byte](smallerRead)
  System.arraycopy(buffer, 0, smallerBuffer, 0, smallerRead)
  Some(smallerBuffer)
````