$ diff SaxHandler.java _SaxHandler_.java 17a18,21 > import java.io.ByteArrayInputStream; > import java.io.ByteArrayOutputStream; > import java.io.IOException; > import java.io.InputStream; 20a25 > import org.seasar.framework.exception.IORuntimeException; 84c89,114 < return new InputSource(ResourceUtil.getResourceAsStream(dtdPath)); --- > > InputStream dtd = null; > try { > dtd = ResourceUtil.getResourceAsStream(dtdPath); > ByteArrayOutputStream output = new ByteArrayOutputStream(); > byte[] buffer = new byte[1024]; > long count = 0; > int n = 0; > while (-1 != (n = dtd.read(buffer))) { > output.write(buffer, 0, n); > count += n; > } > return new InputSource(new ByteArrayInputStream(output > .toByteArray())); > } catch (IOException e) { > throw new IORuntimeException(e); > } finally { > if (dtd != null) { > try { > dtd.close(); > dtd = null; > } catch (IOException e) { > throw new IORuntimeException(e); > } > } > }