RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]

Vyom Tewari vtewari at openjdk.org
Wed Aug 23 15:01:06 UTC 2023


> With the current  implementation of BufferedOutputStream if you close the stream and try to write to the closed stream BufferedOutputStream does not throw an IOException until the internal buffer is full. To fix this issue i added a private  "ensureOpen" function to BufferedOutputStream which will check if the underline stream is open. If the underline stream is closed "ensureOpen" will throw the IOException.

Vyom Tewari has updated the pull request incrementally with one additional commit since the last revision:

  make the isOpen method to package private

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/15361/files
  - new: https://git.openjdk.org/jdk/pull/15361/files/5a12a6af..ffc93a71

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=15361&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15361&range=00-01

  Stats: 11 lines in 3 files changed: 8 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/15361.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15361/head:pull/15361

PR: https://git.openjdk.org/jdk/pull/15361


More information about the core-libs-dev mailing list