ByteArrayDataSource¶
-
public class
ByteArrayDataSource
implements DataSource¶ ByteArrayDataSource is an implementation of the javax.activation.DataSource that represents a data source of a byte array.
Author: Hugo Y. K. Lam
Constructors¶
ByteArrayDataSource¶
-
public
ByteArrayDataSource
(byte[] bytes)¶ Creates a new instance of ByteArrayDataSource.
Parameters: - bytes – the bytes source.
ByteArrayDataSource¶
Methods¶
getInputStream¶
-
public InputStream
getInputStream
()¶ Returns a new input stream representing the bytes source.
Returns: a new byte array input stream.
getName¶
-
public String
getName
()¶ Gets the name of the underlying content.
Returns: the name of the underlying content. See also:
javax.activation.DataSource.getName()
getOutputStream¶
-
public OutputStream
getOutputStream
()¶ This method always throw IO exception.
Throws: - IOException – as output stream is not supported by this data source.