public class ByteArrayDataSource extends DataSource
DEFAULT_INTRO_LIMIT, MARK_WORKAROUND_PROPERTY| Constructor and Description |
|---|
ByteArrayDataSource(String name,
byte[] buffer)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Returns a name for this source.
|
InputStream |
getRawInputStream()
Provides a new InputStream for this data source.
|
long |
getRawLength()
Returns the length in bytes of the stream returned by
getRawInputStream, if known. |
close, forceCompression, getCompression, getHybridInputStream, getInputStream, getInputStream, getIntro, getIntroLimit, getLength, getMarkWorkaround, getPosition, getSystemId, getURL, makeDataSource, makeDataSource, makeDataSource, setCompression, setIntroLimit, setMarkWorkaround, setName, setPosition, toStringpublic ByteArrayDataSource(String name, byte[] buffer)
name - data source namebuffer - containing byte content of the sourcepublic String getName()
DataSourceDataSource.getURL() method
(or some suitable class-specific method) should be used.
If this source has a position, it should probably form part of
this name.getName in class DataSourcepublic InputStream getRawInputStream()
DataSourcegetRawInputStream in class DataSourcepublic long getRawLength()
DataSourcegetRawInputStream, if known. If the length is not known
then -1 should be returned.
The implementation of this method in DataSource returns -1;
subclasses should override it if they can determine their length.getRawLength in class DataSourceCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.