DataSource
public final class ByteArrayDataSource extends Object implements DataSource
DataSource
backed by a byte buffer.Constructor | Description |
---|---|
ByteArrayDataSource(byte[] buf,
int length,
String contentType) |
|
ByteArrayDataSource(byte[] buf,
String contentType) |
Modifier and Type | Method | Description |
---|---|---|
String |
getContentType() |
|
InputStream |
getInputStream() |
|
String |
getName() |
|
OutputStream |
getOutputStream() |
public ByteArrayDataSource(byte[] buf, String contentType)
buf
- input buffer - the byte array isn't being copied; used directlycontentType
- public ByteArrayDataSource(byte[] buf, int length, String contentType)
buf
- input buffer - the byte array isn't being copied; used directlylength
- contentType
- public String getContentType()
getContentType
in interface DataSource
public InputStream getInputStream()
getInputStream
in interface DataSource
public String getName()
getName
in interface DataSource
public OutputStream getOutputStream()
getOutputStream
in interface DataSource
Copyright © 2018 Oracle Corporation. All rights reserved.