Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / January 2006

Tip: Looking for answers? Try searching our database.

Asking help for a java io problem

Thread view: 
witkowski@163.com - 17 Jan 2006 14:31 GMT
Hello, guys! I have a problem running the following code with eclipse
showing that:

java.io.IOException: Stream closed
    at sun.nio.cs.StreamDecoder.ensureOpen(Unknown Source)
    at sun.nio.cs.StreamDecoder.read(Unknown Source)
    at java.io.InputStreamReader.read(Unknown Source)
    at HtmlFileParser.parseHtmlDoc(HtmlFileParser.java:32)
    at HtmlFileParser.main(HtmlFileParser.java:52)

//code here:
        try{
           FileInputStream fin = new FileInputStream("test.html");
           InputStreamReader fr = new InputStreamReader(fin);
           for(i=0; i<2048; i++) buf[i] = '0';
           fr.read(buf, 0, 2048);         //problem here (line 32)
           FileWriter fw = new FileWriter("bufWriteTest.txt");
           fw.write(buf);
           fw.flush();
        }
        catch(FileNotFoundException e)    {
           e.printStackTrace();
        }
        catch(IOException e)    {
           e.printStackTrace();
        }
There are no syntax erro in the above code, it just dosen't work,
please help me finding out what the problem is, thank you.
klynn47@comcast.net - 17 Jan 2006 15:01 GMT
Are you sure the file test.html exists, and that you have access to it?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.