|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xml.sax.InputSource | +--org.enhydra.xml.io.ClosingInputSource
Input source that automatically close its InputStream when EOF is reached or an error occurs. This works around a flaw in the SAX API where there is not method of an entity handler that opens a stream to be informed when the stream is no longer needed.
Constructor Summary | |
ClosingInputSource()
Zero-argument default constructor. |
|
ClosingInputSource(InputSource inputSource,
boolean openNow)
Create a new input source from another input source. |
|
ClosingInputSource(InputStream byteStream)
Create a new input source with a byte stream. |
|
ClosingInputSource(Reader characterStream)
Create a new input source with a character stream. |
|
ClosingInputSource(String systemId)
Create a new input source with a system identifier. |
|
ClosingInputSource(String systemId,
boolean openNow)
Create a new input source with a system identifier. |
Method Summary | |
void |
open()
If the resource is specified by system id, open it now as a byte stream. |
void |
setByteStream(InputStream byteStream)
Set the byte stream, copying it to a buffer. |
void |
setCharacterStream(Reader characterStream)
Set the character stream, copying it to a buffer. |
Methods inherited from class org.xml.sax.InputSource |
getByteStream, getCharacterStream, getEncoding, getPublicId, getSystemId, setEncoding, setPublicId, setSystemId |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public ClosingInputSource()
InputSource.InputSource()
public ClosingInputSource(InputSource inputSource, boolean openNow) throws IOException
inputSource
- Input source specification to cloneopenNow
- If true, the input source is opened immediatly
if specified as a system id.InputSource
public ClosingInputSource(String systemId)
systemId
- The system identifier.InputSource.InputSource(String)
public ClosingInputSource(String systemId, boolean openNow) throws IOException
systemId
- The system identifier.openNow
- If true, the input source is opened immediatly
if specified as a system id.IOException
- If an error occures opening the stream.InputSource.InputSource(String)
public ClosingInputSource(InputStream byteStream)
InputSource.InputSource(InputStream)
public ClosingInputSource(Reader characterStream)
InputSource.InputSource(Reader)
Method Detail |
public void open() throws IOException
public void setByteStream(InputStream byteStream)
setByteStream
in class InputSource
InputSource.setByteStream(java.io.InputStream)
public void setCharacterStream(Reader characterStream)
setCharacterStream
in class InputSource
InputSource.setCharacterStream(java.io.Reader)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |