Is it safe to attempt to close a stream (eg an InputStream for a Socket) if the stream has already been closed? Or do I need to check for that possibility?
The documentation doesn’t specify, but I would guess that if you call the “close()” method on a Socket, or an InputStream that is already closed, probably nothing will happen - in other words, it won’t crash your program or throw an exception.
This would be easy to test in a quick loop.