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, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInputStream, 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()
DataSourceDefaultMethods
DataSource
and discard any input on any
open DataSourceDefaultMethods.getOutputStream()
.public long length()
DataSourceDefaultMethods
this
DataSource
; -1
if the count is unknown.public InputStream getInputStream() throws IOException
IOException
public OutputStream getOutputStream() throws IOException
IOException
Copyright © 2015–2020 Allen D. Ball. All rights reserved.