- java.lang.Object
-
- com.sun.istack.ByteArrayDataSource
-
- All Implemented Interfaces:
jakarta.activation.DataSource
public final class ByteArrayDataSource extends Object implements jakarta.activation.DataSource
DataSourcebacked by a byte buffer.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description ByteArrayDataSource(byte[] buf, int length, String contentType)ByteArrayDataSource(byte[] buf, String contentType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContentType()InputStreamgetInputStream()StringgetName()OutputStreamgetOutputStream()
-
-
-
Constructor Detail
-
ByteArrayDataSource
public ByteArrayDataSource(byte[] buf, String contentType)- Parameters:
buf- input buffer - the byte array isn't being copied; used directlycontentType-
-
ByteArrayDataSource
public ByteArrayDataSource(byte[] buf, int length, String contentType)- Parameters:
buf- input buffer - the byte array isn't being copied; used directlylength-contentType-
-
-
Method Detail
-
getContentType
public String getContentType()
- Specified by:
getContentTypein interfacejakarta.activation.DataSource
-
getInputStream
public InputStream getInputStream()
- Specified by:
getInputStreamin interfacejakarta.activation.DataSource
-
getName
public String getName()
- Specified by:
getNamein interfacejakarta.activation.DataSource
-
getOutputStream
public OutputStream getOutputStream()
- Specified by:
getOutputStreamin interfacejakarta.activation.DataSource
-
-