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 void
clear()
Method to clear theDataSource
and discard any input on any openDataSourceDefaultMethods.getOutputStream()
.InputStream
getInputStream()
OutputStream
getOutputStream()
long
length()
Method to get the number of bytes stored inthis
DataSource
.-
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:DataSourceDefaultMethods
Method to clear theDataSource
and discard any input on any openDataSourceDefaultMethods.getOutputStream()
.
-
length
public long length()
Description copied from interface:DataSourceDefaultMethods
- Returns:
- The number of bytes stored in
this
DataSource
;-1
if the count is unknown.
-
getInputStream
public InputStream getInputStream() throws IOException
- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Throws:
IOException
-
-