public class Stax2ByteArraySource extends Stax2BlockSource
Stax2BlockSource
that encapsulates
a byte array.
Note that no copy is made of the passed-in array, and that further there are direct access methods. Thus, although callers are not to modify contents of returned array, this can not be guaranteed; and as such if this would be a problem (security problem for example), caller has to make a copy of the array and pass that copy to the constructor.
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DEFAULT_ENCODING |
(package private) byte[] |
mBuffer |
(package private) int |
mLength |
(package private) int |
mStart |
mEncoding, mPublicId, mSystemId
Constructor and Description |
---|
Stax2ByteArraySource(byte[] buf,
int start,
int len) |
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
constructInputStream()
This method creates an
InputStream via which underlying input
source can be accessed. |
java.io.Reader |
constructReader()
Note: if encoding is not explicitly defined, UTF-8 is assumed.
|
byte[] |
getBuffer() |
int |
getBufferEnd() |
int |
getBufferLength() |
int |
getBufferStart() |
getReference
getEncoding, getPublicId, getSystemId, setEncoding, setPublicId, setSystemId
private static final java.lang.String DEFAULT_ENCODING
final byte[] mBuffer
final int mStart
final int mLength
public java.io.Reader constructReader() throws java.io.IOException
constructReader
in class Stax2BlockSource
java.io.IOException
public java.io.InputStream constructInputStream() throws java.io.IOException
Stax2Source
InputStream
via which underlying input
source can be accessed. Note that caller is responsible for
closing that InputSource when it is done reading itconstructInputStream
in class Stax2BlockSource
java.io.IOException
public byte[] getBuffer()
public int getBufferStart()
public int getBufferLength()
public int getBufferEnd()