Skip navigation links 
 
com.bea.wli.sb.sources
Class ByteArraySource
java.lang.Object
   com.bea.wli.sb.sources.ByteArraySource
com.bea.wli.sb.sources.ByteArraySource
- All Implemented Interfaces:
- Source, java.io.Serializable
- 
public class ByteArraySource
 
- extends java.lang.Object
- implements Source, java.io.Serializable
A byte-stream Source whose content comes from a byte array. As a byte-stream source, the serialization methods do not heed any transformation options.
- See Also:
- Serialized Form
 
 
  
 
  
 
| Method Summary | 
|  byte[] | getBytes()Returns the underlying byte-array.
 | 
|  java.io.InputStream | getInputStream(TransformOptions options)Returns streaming byte-baseed representation of the Source's content.
 | 
|  void | writeTo(java.io.OutputStream out, TransformOptions options)Serializes the Source's content to a byte-based stream.
 | 
 
| Methods inherited from class java.lang.Object | 
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
 
ByteArraySource
public ByteArraySource(byte[] bytes)
ByteArraySource
public ByteArraySource(byte[] bytes,
                       int pos,
                       int count)
getBytes
public byte[] getBytes()
- Returns the underlying byte-array. Note that this may or maynot be a copy! If the caller wishes to modify this byte-array, it should cease all further usage of this ByteArraySource.
getInputStream
public java.io.InputStream getInputStream(TransformOptions options)
                                   throws java.io.IOException,
                                          TransformException
- Description copied from interface: Source
- Returns 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 interface- Source
 
- 
- Parameters:
- options- Options used to affect the serialization
- Returns:
- an InputStream for retrieving the serialized content
- Throws:
- java.io.IOException
- TransformException
 
writeTo
public void writeTo(java.io.OutputStream out,
                    TransformOptions options)
             throws java.io.IOException,
                    TransformException
- Description copied from interface: Source
- Serializes 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. <p/> Note that this method may involve an internal transformation, although it should not in any way change the underlying content.
- 
- Specified by:
- writeToin interface- Source
 
- 
- Parameters:
- out- the OutputStream to which serialized content will be written
- options- TransformOptions used to affect the serialization
- Throws:
- java.io.IOException
- TransformException
 
Skip navigation links 
 
Copyright © 2008, 2013, Oracle. All rights reserved.