public class ByteArrayDataSource extends AbstractDataSource
APPLICATION_OCTET_STREAM, APPLICATION_XML, CONTENT_TYPE, TEXT_HTML, TEXT_PLAIN| Constructor and Description |
|---|
ByteArrayDataSource(String name,
String type) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Method to clear the
DataSource and discard any input on any
open DataSourceDefaultMethods.getOutputStream(). |
InputStream |
getInputStream() |
OutputStream |
getOutputStream() |
long |
length()
Method to get the number of bytes stored in
this
DataSource. |
getContentType, getName, setContentType, setNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInputStream, getOutputStream, wrap, wrap, writeTo@ConstructorProperties(value={"name","contentType"}) public ByteArrayDataSource(String name, String type)
name - Initial "Name" attribute value.type - Initial "ContentType" attribute
value.public void clear()
DataSourceDefaultMethodsDataSource and discard any input on any
open DataSourceDefaultMethods.getOutputStream().public long length()
DataSourceDefaultMethodsthis
DataSource; -1 if the count is unknown.public InputStream getInputStream() throws IOException
IOExceptionpublic OutputStream getOutputStream() throws IOException
IOExceptionCopyright © 2015–2021. All rights reserved.