|
||||||||||
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 buffer 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
Constructor Summary | |
---|---|
InputStreamWrapper()
|
Method Summary | |
---|---|
void |
close()
Close document input. |
IInByteBuffer |
getBuffer()
Get input buffer. |
String |
getEncoding()
Get encoding for input document. |
Reader |
getReader()
Get reader for wrapped input stream. |
void |
reset()
Reset to initial state for reuse. |
void |
setBuffer(IInByteBuffer buff)
Set the input buffer. |
void |
setEncoding(String enc)
Set encoding for stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InputStreamWrapper()
Method Detail |
---|
public void setBuffer(IInByteBuffer buff)
buff
- public IInByteBuffer getBuffer()
null
if none setpublic void setEncoding(String enc) throws IOException
enc
- character encoding used for input from stream
(null
if to be determined from XML input)
IOException
- if unknown encoding, or encoding already setpublic Reader getReader() throws IOException
IOException
- if error reading from document or creating a reader
for the encoding foundpublic String getEncoding()
getReader()
is called.
public void close() throws IOException
IOException
- on error closing documentpublic void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |