- java.lang.Object
-
- com.sun.istack.ByteArrayDataSource
-
- All Implemented Interfaces:
DataSource
public final class ByteArrayDataSource extends Object implements 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 interfaceDataSource
-
getInputStream
public InputStream getInputStream()
- Specified by:
getInputStreamin interfaceDataSource
-
getName
public String getName()
- Specified by:
getNamein interfaceDataSource
-
getOutputStream
public OutputStream getOutputStream()
- Specified by:
getOutputStreamin interfaceDataSource
-
-