- java.lang.Object
-
- com.sun.istack.ByteArrayDataSource
-
- All Implemented Interfaces:
javax.activation.DataSource
public final class ByteArrayDataSource extends Object implements javax.activation.DataSource
DataSource
backed 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 String
getContentType()
InputStream
getInputStream()
String
getName()
OutputStream
getOutputStream()
-
-
-
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:
getContentType
in interfacejavax.activation.DataSource
-
getInputStream
public InputStream getInputStream()
- Specified by:
getInputStream
in interfacejavax.activation.DataSource
-
getName
public String getName()
- Specified by:
getName
in interfacejavax.activation.DataSource
-
getOutputStream
public OutputStream getOutputStream()
- Specified by:
getOutputStream
in interfacejavax.activation.DataSource
-
-