public class RawDataSource
extends java.lang.Object
implements javax.activation.DataSource
RawDataSource
class is a generic DataSource implementation
that handles raw data from a byte array or InputStream with any reported mime
type.Constructor and Description |
---|
RawDataSource(RawInputStream in,
java.lang.String mimeType)
Creates a RawDataSource from a RawInputStream.
|
RawDataSource(RawInputStream in,
java.lang.String mimeType,
java.lang.String name)
Creates a RawDataSource from a RawInputStream.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType()
Returns the MIME content type associated with the raw data bytes.
|
java.io.InputStream |
getInputStream()
Returns an InputStream providing the raw data bytes.
|
java.lang.String |
getName()
Returns a name associated with the raw data bytes.
|
java.io.OutputStream |
getOutputStream()
Returns an OutputStream for setting the raw data bytes.
|
public RawDataSource(RawInputStream in, java.lang.String mimeType)
in
- the RawInputStream providing the datamimeType
- the mime type of the datapublic RawDataSource(RawInputStream in, java.lang.String mimeType, java.lang.String name)
in
- the RawInputStream providing the datamimeType
- the mime type of the dataname
- the name associated with the data (such as a filename)public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in interface javax.activation.DataSource
java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in interface javax.activation.DataSource
java.io.IOException
public java.lang.String getContentType()
getContentType
in interface javax.activation.DataSource
public java.lang.String getName()
getName
in interface javax.activation.DataSource
Copyright © 2021. All Rights Reserved.