public class ByteArrayDataSource extends Object implements SizeAwareDataSource
Constructor and Description |
---|
ByteArrayDataSource(byte[] data) |
ByteArrayDataSource(byte[] data,
String type) |
Modifier and Type | Method and Description |
---|---|
String |
getContentType() |
InputStream |
getInputStream() |
String |
getName() |
OutputStream |
getOutputStream() |
long |
getSize()
Get the size of the data source.
|
void |
setType(String type) |
public ByteArrayDataSource(byte[] data, String type)
public ByteArrayDataSource(byte[] data)
public void setType(String type)
public String getContentType()
getContentType
in interface DataSource
public InputStream getInputStream() throws IOException
getInputStream
in interface DataSource
IOException
public String getName()
getName
in interface DataSource
public OutputStream getOutputStream() throws IOException
getOutputStream
in interface DataSource
IOException
public long getSize()
SizeAwareDataSource
DataSource.getInputStream()
before reaching
the end of the stream. If the implementation is unable to determine the
size, it must return -1.getSize
in interface SizeAwareDataSource
Copyright © 2004–2015 The Apache Software Foundation. All rights reserved.