Top Description Fields Constructors Methods
org.codehaus.stax2.io

public Class Stax2ByteArraySource

extends Stax2BlockSource
Class Inheritance
Imports
java.io.*

Simple implementation of 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.

Field Summary

Modifier and TypeField and Description
private static final String
pack-priv final byte[]
pack-priv final int
pack-priv final int

Constructor Summary

AccessConstructor and Description
public
Stax2ByteArraySource(byte[] buf, int start, int len)

Method Summary

Modifier and TypeMethod and Description
public InputStream
constructInputStream()

Implements abstract org.codehaus.stax2.io.Stax2BlockSource.constructInputStream.

This method creates an InputStream via which underlying input source can be accessed.
public Reader
constructReader()

Implements abstract org.codehaus.stax2.io.Stax2BlockSource.constructReader.

Note

if encoding is not explicitly defined, UTF-8 is assumed.

public byte[]
public int
public int
public int
Inherited from org.codehaus.stax2.io.Stax2BlockSource:
getReference

Field Detail

DEFAULT_ENCODINGback to summary
private static final String DEFAULT_ENCODING
mBufferback to summary
pack-priv final byte[] mBuffer
mLengthback to summary
pack-priv final int mLength
mStartback to summary
pack-priv final int mStart

Constructor Detail

Stax2ByteArraySourceback to summary
public Stax2ByteArraySource(byte[] buf, int start, int len)

Method Detail

constructInputStreamback to summary
public InputStream constructInputStream() throws IOException

Implements abstract org.codehaus.stax2.io.Stax2BlockSource.constructInputStream.

Doc from org.codehaus.stax2.io.Stax2Source.constructInputStream.

This method creates an InputStream via which underlying input source can be accessed. Note that caller is responsible for closing that InputSource when it is done reading it

Annotations
@Override
constructReaderback to summary
public Reader constructReader() throws IOException

Implements abstract org.codehaus.stax2.io.Stax2BlockSource.constructReader.

Note

if encoding is not explicitly defined, UTF-8 is assumed.

Annotations
@Override
getBufferback to summary
public byte[] getBuffer()
getBufferEndback to summary
public int getBufferEnd()
getBufferLengthback to summary
public int getBufferLength()
getBufferStartback to summary
public int getBufferStart()