*) closing stream correctly

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@293 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
theli 2005-06-17 07:58:02 +00:00
parent aea355c03c
commit db3ed75728

View File

@ -93,10 +93,23 @@ public abstract class AbstractParser implements Parser{
*
* @see de.anomic.plasma.parser.Parser#parse(java.net.URL, java.lang.String, byte[])
*/
public plasmaParserDocument parse(URL location, String mimeType,
byte[] source) throws ParserException {
ByteArrayInputStream contentInputStream = new ByteArrayInputStream(source);
return this.parse(location,mimeType,contentInputStream);
public plasmaParserDocument parse(
URL location,
String mimeType,
byte[] source
) throws ParserException {
ByteArrayInputStream contentInputStream = null;
try {
contentInputStream = new ByteArrayInputStream(source);
return this.parse(location,mimeType,contentInputStream);
} finally {
if (contentInputStream != null) {
try {
contentInputStream.close();
contentInputStream = null;
} catch (Exception e){}
}
}
}
/**