| 
 | Oracle® XML Java API Reference Release 1 (10.1) B12024-01 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.soap.util.mime.ByteArrayDataSource
This class implements a typed DataSource from an InputStream, a byte array, a String, a File.
| Constructor Summary | |
| ByteArrayDataSource(byte[] data, java.lang.String type)Create a datasource from a byte array. | |
| ByteArrayDataSource(java.io.File f, java.lang.String type)Create a datasource from a File. | |
| ByteArrayDataSource(java.io.InputStream is, java.lang.String type)Create a datasource from an input stream. | |
| ByteArrayDataSource(java.lang.String data, java.lang.String type)Create a datasource from a String. | |
| Method Summary | |
|  java.lang.String | getContentType()Get the content type. | 
|  java.io.InputStream | getInputStream()Return an InputStream to read the content. | 
|  java.lang.String | getName()getName() is not implemented. | 
|  java.io.OutputStream | getOutputStream()This DataSource cannot return an OutputStream, so this method is not implemented. | 
|  int | getSize()Return the number of bytes in the content. | 
|  java.lang.String | getText()Return the content as a String. | 
|  void | setContentType(java.lang.String type)Set the content type. | 
|  byte[] | toByteArray()Return the content as a byte array. | 
|  void | writeTo(java.io.OutputStream os)Write the content to an OutputStream. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public ByteArrayDataSource(java.io.File f,
                           java.lang.String type)
                    throws java.io.IOException
f - File objecttype - Content-Type
public ByteArrayDataSource(java.io.InputStream is,
                           java.lang.String type)
                    throws java.io.IOException
is - InputStreamtype - Content-Type
public ByteArrayDataSource(byte[] data,
                           java.lang.String type)
data - byte arraytype - Content-Type
public ByteArrayDataSource(java.lang.String data,
                           java.lang.String type)
data - byte arraytype - Content-Type| Method Detail | 
public java.io.InputStream getInputStream()
                                   throws java.io.IOException
java.io.IOException
public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getContentType()
public void setContentType(java.lang.String type)
public java.lang.String getName()
public void writeTo(java.io.OutputStream os)
             throws java.io.IOException
os - OutputStream to write the entire content tojava.io.IOExceptionpublic byte[] toByteArray()
public int getSize()
public java.lang.String getText()
| 
 | Oracle® XML Java API Reference Release 1 (10.1) B12024-01 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||