Skip to content

Commit

Permalink
Cover BufferReleasingInputStream.available under tryOrFetchFailedExce…
Browse files Browse the repository at this point in the history
…ption
  • Loading branch information
viirya committed Oct 26, 2023
1 parent 5364392 commit bef28ff
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ private class BufferReleasingInputStream(
}
}

override def available(): Int = delegate.available()
override def available(): Int = tryOrFetchFailedException(delegate.available())

override def mark(readlimit: Int): Unit = delegate.mark(readlimit)

Expand All @@ -1374,7 +1374,8 @@ private class BufferReleasingInputStream(
/**
* Execute a block of code that returns a value, close this stream quietly and re-throwing
* IOException as FetchFailedException when detectCorruption is true. This method is only
* used by the `read` and `skip` methods inside `BufferReleasingInputStream` currently.
* used by the `available`, `read` and `skip` methods inside `BufferReleasingInputStream`
* currently.
*/
private def tryOrFetchFailedException[T](block: => T): T = {
try {
Expand Down

0 comments on commit bef28ff

Please sign in to comment.