Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Closing a stream  (Read 921 times)
0 Members and 1 Guest are viewing this topic.
Offline 20thCenturyBoy

Full Member
**

Posts: 118


Ooh my head hurts...


« on: 2004-06-25 09:38:11 »

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?
kul_th_las
Guest
« Reply #1 on: 2004-06-25 16:28:48 »

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.
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.066 seconds with 22 queries.