|
Close the file yourself in a finally block.
Example:
InputStream someStream = null;
try
{
someStream = new BufferedInputStream( new
FileInputStream( "someFile" ) );// Any variation should work
parser.parse( new InputSource( someStream )
);
}
catch( SAXException sax ){ /* handle exception */
}
finally
{
if( null != someStream )
try
{
someStream.close();
}
catch( IOException
io ){}// ignore because parser may have closed it if parsing was
successfull
}
|
Title: RE: Explicit file closing
- RE: Explicit file closing Roytman, Alex
- Re: Explicit file closing Dane Foster
- Re: Explicit file closing Chad Loder
- RE: Explicit file closing Brad O'Hearne
- Re: Explicit file closing Dane Foster
- RE: Explicit file closing Brad O'Hearne
- Re: Explicit file closing Andy Clark
- Re: Explicit file closing Andy Clark
- RE: Explicit file closing Brad O'Hearne
- RE: Explicit file closing Jodeleit, Peter
- Re: Explicit file closing Andy Clark
- RE: Explicit file closing Brad O'Hearne
