Package org.codehaus.stax2.io
Class Stax2BlockSource
java.lang.Object
org.codehaus.stax2.io.Stax2Source
org.codehaus.stax2.io.Stax2BlockSource
- All Implemented Interfaces:
Source
- Direct Known Subclasses:
Stax2ByteArraySource
,Stax2CharArraySource
,Stax2StringSource
This is the mid-level abstract base class for
Stax2Source
s
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
Fields inherited from class org.codehaus.stax2.io.Stax2Source
mEncoding, mPublicId, mSystemId
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract InputStream
This method creates anInputStream
via which underlying input source can be accessed.abstract Reader
This method creates aReader
via which underlying input source can be accessed.Usually there is no way to refer to the underlying data source, since they are in-memory data structures.Methods inherited from class org.codehaus.stax2.io.Stax2Source
getEncoding, getPublicId, getSystemId, setEncoding, setPublicId, setSystemId
-
Constructor Details
-
Stax2BlockSource
protected Stax2BlockSource()
-
-
Method Details
-
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.- Specified by:
getReference
in classStax2Source
- Returns:
- 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)
-
constructReader
Description copied from class:Stax2Source
This method creates aReader
via which underlying input source can be accessed. Note that caller is responsible for closing that Reader when it is done reading it.- Specified by:
constructReader
in classStax2Source
- Throws:
IOException
-
constructInputStream
Description copied from class:Stax2Source
This method creates anInputStream
via which underlying input source can be accessed. Note that caller is responsible for closing that InputSource when it is done reading it- Specified by:
constructInputStream
in classStax2Source
- Throws:
IOException
-