OutputStream implements flush() but close() does not invoke it
Open
Type-NewCheck
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
Closing an OutputStream could discard unflushed bytes. While nothing in the spec explicitly forbids that behavior, no user would expect it, and an "always flush before you close" guideline would be a burden that would never pay for itself.
Can we detect OutputStreams that have this problematic behavior somehow? Unfortunately, I'm sure we can't detect it very reliably, but we could do a smell test and accept some false positives....
I wanted to capture this idea but I am not sure it is worth worrying about.
Contributor guide
Assessment
This issue has not been assessed yet.