| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | 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
getInputStream in interface javax.activation.DataSource
public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
getOutputStream in interface javax.activation.DataSourcepublic java.lang.String getContentType()
getContentType in interface javax.activation.DataSourcepublic void setContentType(java.lang.String type)
Content-Type - stringpublic java.lang.String getName()
getName in interface javax.activation.DataSource
public void writeTo(java.io.OutputStream os)
             throws java.io.IOException
os - OutputStream to write the entire content topublic byte[] toByteArray()
public int getSize()
public java.lang.String getText()
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||