|
Apache SOAP API Reference | ||||||||||
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-Typepublic ByteArrayDataSource(java.io.InputStream is, java.lang.String type) throws java.io.IOException
is
- InputStreamtype
- Content-Typepublic ByteArrayDataSource(byte[] data, java.lang.String type)
data
- byte arraytype
- Content-Typepublic ByteArrayDataSource(java.lang.String data, java.lang.String type)
data
- byte arraytype
- Content-TypeMethod Detail |
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface javax.activation.DataSource
java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in interface javax.activation.DataSource
java.io.IOException
public java.lang.String getContentType()
getContentType
in interface javax.activation.DataSource
public void setContentType(java.lang.String type)
public 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 tojava.io.IOException
public byte[] toByteArray()
public int getSize()
public java.lang.String getText()
|
Apache SOAP API Reference | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |