|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jibx.runtime.impl.InputStreamWrapper
public class InputStreamWrapper
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
Field Summary | |
---|---|
static int |
DEFAULT_BUFFER_SIZE
Default input buffer size. |
Constructor Summary | |
---|---|
InputStreamWrapper()
Constructor using default buffer size. |
|
InputStreamWrapper(int size)
Constructor. |
Method Summary | |
---|---|
void |
close()
Close document input. |
java.lang.String |
getEncoding()
Get encoding for input document. |
java.io.Reader |
getReader()
Get reader for wrapped input stream. |
void |
reset()
Reset to initial state for reuse. |
void |
setEncoding(java.lang.String enc)
Set encoding for stream. |
void |
setInput(java.io.InputStream ins)
Set input stream with encoding to be defined later. |
void |
setInput(java.io.InputStream ins,
java.lang.String enc)
Set input stream with specified encoding. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_BUFFER_SIZE
Constructor Detail |
---|
public InputStreamWrapper(int size)
public InputStreamWrapper()
Method Detail |
---|
public void setInput(java.io.InputStream ins)
ins
- stream for document data inputpublic void setInput(java.io.InputStream ins, java.lang.String enc) throws java.io.IOException
ins
- stream for document data inputenc
- character encoding used for input from stream
(null
if to be determined from XML input)
java.io.IOException
public void setEncoding(java.lang.String enc) throws java.io.IOException
enc
- character encoding used for input from stream
(null
if to be determined from XML input)
java.io.IOException
- if unknown encoding, or encoding already setpublic java.io.Reader getReader() throws java.io.IOException
java.io.IOException
- if error reading from document or creating a reader
for the encoding foundpublic java.lang.String getEncoding()
getReader()
is called.
public void close() throws java.io.IOException
java.io.IOException
- on error closing documentpublic void reset()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |