Re: Closing a stream in an applet causes a crash
On 01/30/2011 08:34 PM, Sam Takoy wrote:
On 1/30/2011 7:58 PM, Esmond Pitt wrote:
On 31/01/2011 11:04 AM, Sam Takoy wrote:
And everything works perfectly in terms of opening the stream and
reading from it, until I attempt is.close() - then I get the
java.io.IOException: stream is closed
exception.
That exception means you have already closed the stream or the
connection yourself. Somewhere in the part starting /////.
Thanks for the responses, but like I said, I run the same code as an
application and as an applet and it fails only in the applet.
Well, la-dee-dah. Since you have not deigned to share your code with us I
guess we'll have to be in the dark about what you're doing differently in the
application context from the applet context. Since applets and applications
start differently, one thing we can be sure of is that it's not the same code.
Also, IOExceptions arise from external circumstances, i.e., the failure of an
I/O operation. Application and applet environments are notably different. No
doubt you are failing to handle that difference correctly.
Another thing we can be sure of is that your carefully hidden code contains no
exception handler for the 'close()' operation. Tsk, tsk.
http://sscce.org/ if you want answers beyond, "Well, you did something wrong."
That's all we can conclude based on the dearth of information you see fit to
dole out.
--
Lew
Ceci n'est pas une fen??tre.
..___________.
|###] | [###|
|##/ | *\##|
|#/ * | \#|
|#----|----#|
|| | * ||
|o * | o|
|_____|_____|
|===========|