Package ball.activation
Class ByteArrayDataSource
- java.lang.Object
-
- ball.activation.AbstractDataSource
-
- ball.activation.ByteArrayDataSource
-
- All Implemented Interfaces:
DataSourceDefaultMethods,DataSource
public class ByteArrayDataSource extends AbstractDataSource
- Author:
- Allen D. Ball
-
-
Field Summary
-
Fields inherited from interface ball.activation.DataSourceDefaultMethods
APPLICATION_OCTET_STREAM, APPLICATION_XML, CONTENT_TYPE, TEXT_HTML, TEXT_PLAIN
-
-
Constructor Summary
Constructors Constructor Description ByteArrayDataSource(String name, String type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Method to clear theDataSourceand discard any input on any openDataSourceDefaultMethods.getOutputStream().InputStreamgetInputStream()OutputStreamgetOutputStream()longlength()Method to get the number of bytes stored inthisDataSource.-
Methods inherited from class ball.activation.AbstractDataSource
getContentType, getName, setContentType, setName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ball.activation.DataSourceDefaultMethods
getInputStream, getOutputStream, wrap, wrap
-
-
-
-
Constructor Detail
-
ByteArrayDataSource
@ConstructorProperties({"name","contentType"}) public ByteArrayDataSource(String name, String type)
- Parameters:
name- Initial"Name"attribute value.type- Initial"ContentType"attribute value.
-
-
Method Detail
-
clear
public void clear()
Description copied from interface:DataSourceDefaultMethodsMethod to clear theDataSourceand discard any input on any openDataSourceDefaultMethods.getOutputStream().
-
length
public long length()
Description copied from interface:DataSourceDefaultMethods- Returns:
- The number of bytes stored in
thisDataSource;-1if the count is unknown.
-
getInputStream
public InputStream getInputStream() throws IOException
- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Throws:
IOException
-
-