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

public abstract Class Stax2BlockSource

extends Stax2Source
Class Inheritance
Known Direct Subclasses
org.codehaus.stax2.io.Stax2ByteArraySource, org.codehaus.stax2.io.Stax2CharArraySource, org.codehaus.stax2.io.Stax2StringSource
Imports
java.io.*, java.net.URL

This is the mid-level abstract base class for Stax2Sources that an be used to access fixed-length in-memory data sources, such as byte and char arrays, Strings, StringBuffers and so forth. The main reason for using such a source object (instead of constructing wrapper Readers or InputStreams) is that concrete implementations usually also allow more direct access to the underlying data, so that stream reader implementations may be able to do more optimal access.

Field Summary

Inherited from org.codehaus.stax2.io.Stax2Source:
mEncodingmPublicIdmSystemId

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public abstract InputStream
constructInputStream()

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

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

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

This method creates a Reader via which underlying input source can be accessed.
public URL
getReference()

Implements abstract org.codehaus.stax2.io.Stax2Source.getReference.

Usually there is no way to refer to the underlying data source, since they are in-memory data structures.
Inherited from org.codehaus.stax2.io.Stax2Source:
getEncodinggetPublicIdgetSystemIdsetEncodingsetPublicIdsetSystemId

Constructor Detail

Stax2BlockSourceback to summary
protected Stax2BlockSource()

Method Detail

constructInputStreamback to summary
public abstract InputStream constructInputStream() throws IOException

Implements abstract org.codehaus.stax2.io.Stax2Source.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 abstract Reader constructReader() throws IOException

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

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

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

Annotations
@Override
getReferenceback to summary
public URL getReference()

Implements abstract org.codehaus.stax2.io.Stax2Source.getReference.

Usually there is no way to refer to the underlying data source, since they are in-memory data structures. Because of this, the base implementation just returns null.

Returns:URL

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

URL that can be used to resolve references originating from the content read via this source; may be null if not known (which is the case for most non-referential sources)

Annotations
@Override