The Java I/O classes java.io.Reader
, java.io.Writer
, java.io.InputStream
, java.io.OutpuStream
and their various subclasses al
Log it.
You can't really do anything about it (for example write some code that recovers from the error), but its generally worth letting somebody know about it.
Edit:
After further investigation and reading the other comments, I'd say that if you do want to handle it then you're going to have to know details of the implementation. Conversely you probably need to know details of the implementation to decide whether you need to handle it.
Realistically though, I can't think of any examples of streams where the reading or writing would work correctly without throwing an exception, but the closing would.