Package com.bea.wli.sb.sources
Class StringSource
java.lang.Object
com.bea.wli.sb.sources.StringSource
- All Implemented Interfaces:
com.bea.wli.sb.sources.ContentTypeAwareSource,Source,com.bea.wli.sb.sources.TrackPayloadDetails
public class StringSource
extends Object
implements Source, com.bea.wli.sb.sources.TrackPayloadDetails, com.bea.wli.sb.sources.ContentTypeAwareSource
A Source that is backed by a single String. Serialization is simply a
character-set encoded version of the character data.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.bea.wli.sb.sources.TrackPayloadDetails
com.bea.wli.sb.sources.TrackPayloadDetails.StringFormatter, com.bea.wli.sb.sources.TrackPayloadDetails.ThreadLocal, com.bea.wli.sb.sources.TrackPayloadDetails.XmlFormatter -
Field Summary
Fields inherited from interface com.bea.wli.sb.sources.Source
DEFAULT_CHARACTER_SET_ENCODINGFields inherited from interface com.bea.wli.sb.sources.TrackPayloadDetails
PAYLOAD_DETAIL_MAX_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes(int len) getInputStream(TransformOptions options) Returns streaming byte-baseed representation of the Source's content.static StringSourcegetInstance(InputStream in, TransformOptions options) intgetSize()toString()voidwriteTo(OutputStream os, TransformOptions options) Serializes the Source's content to a byte-based stream.
-
Constructor Details
-
StringSource
-
StringSource
-
-
Method Details
-
getContentType
- Specified by:
getContentTypein interfacecom.bea.wli.sb.sources.ContentTypeAwareSource
-
getString
-
getInputStream
Description copied from interface:SourceReturns streaming byte-baseed representation of the Source's content. The representation of that serialization is entirely up to the Source. Note that this method may involve an internal transformation, although it should not in any way change the underlying content.- Specified by:
getInputStreamin interfaceSource- Parameters:
options- Options used to affect the serialization- Returns:
- an InputStream for retrieving the serialized content
- Throws:
IOExceptionTransformException
-
writeTo
public void writeTo(OutputStream os, TransformOptions options) throws IOException, TransformException Description copied from interface:SourceSerializes the Source's content to a byte-based stream. The representation of that serialization is entirely up to the Source. The Source is forbidden from closing the provided OutputStream, although it is allowed to flush it. However, flushing the stream should be left to the caller, if possible.Note that this method may involve an internal transformation, although it should not in any way change the underlying content.
- Specified by:
writeToin interfaceSource- Parameters:
os- the OutputStream to which serialized content will be writtenoptions- TransformOptions used to affect the serialization- Throws:
IOExceptionTransformException
-
getInstance
- Throws:
IOException
-
toString
-
getBytes
public byte[] getBytes(int len) - Specified by:
getBytesin interfacecom.bea.wli.sb.sources.TrackPayloadDetails
-
getSize
public int getSize()- Specified by:
getSizein interfacecom.bea.wli.sb.sources.TrackPayloadDetails
-
getCharset
- Specified by:
getCharsetin interfacecom.bea.wli.sb.sources.TrackPayloadDetails
-