We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This will leak a file handle:
import java.io.{File => JFile, FileInputStream} import better.files._ class BrokenFileInputStream(file: JFile) extends FileInputStream(file) { override def read(b: Array[Byte]): Int = throw new Exception("ouch") } val stream = new BrokenFileInputStream(new JFile("hello.txt")) // assuming hello.txt exists stream.asString(closeStream = true)
Saying closeStream = true means the stream should be closed regardless of whether there was an exception or not?
closeStream = true
The text was updated successfully, but these errors were encountered:
45faf55
No branches or pull requests
This will leak a file handle:
Saying
closeStream = true
means the stream should be closed regardless of whether there was an exception or not?The text was updated successfully, but these errors were encountered: