| java.lang.Object org.jibx.runtime.impl.InputStreamWrapper
InputStreamWrapper | public class InputStreamWrapper (Code) | | Wrapper for input stream that supports multiple character encodings. This is
needed because the XPP3 pull parser does not support detecting the character
encoding for a document based on the content of the document. If used with a
common encoding this performs the conversion to characters using an inner
reader class; otherwise, this creates the appropriate reader type
author: Dennis M. Sosnoski version: 1.0 |
InputStreamWrapper | public InputStreamWrapper()(Code) | | Constructor.
|
close | public void close() throws IOException(Code) | | Close document input. Completes reading of document input, including
closing the input medium.
throws: IOException - on error closing document |
getEncoding | public String getEncoding()(Code) | | Get encoding for input document. This call may not return an accurate
result until after
InputStreamWrapper.getReader is called.
character encoding for input document |
getReader | public Reader getReader() throws IOException(Code) | | Get reader for wrapped input stream. This creates and returns a reader
using the appropriate encoding, if necessary reading and examining the
first part of the stream (including the XML declaration, if present) to
determine the encoding.
throws: IOException - if error reading from document or creating a readerfor the encoding found |
reset | public void reset()(Code) | | Reset to initial state for reuse.
|
setEncoding | public void setEncoding(String enc) throws IOException(Code) | | Set encoding for stream. This call is only valid if the encoding has not
been set previously, and if the encoding is a recognized type.
Parameters: enc - character encoding used for input from stream(null if to be determined from XML input) throws: IOException - if unknown encoding, or encoding already set |
setInput | public void setInput(InputStream ins)(Code) | | Set input stream with encoding to be defined later. If an input stream is
currently open when this is called the existing stream is closed, with
any errors ignored.
Parameters: ins - stream for document data input |
setInput | public void setInput(InputStream ins, String enc) throws IOException(Code) | | Set input stream with specified encoding. If an input stream is currently
open when this is called the existing stream is closed, with any errors
ignored.
Parameters: ins - stream for document data input Parameters: enc - character encoding used for input from stream(null if to be determined from XML input) throws: IOException - |
|
|