Top Description Fields Constructors Methods
org.eclipse.persistence.internal.oxm

public Class ByteArrayDataSource

extends Object
implements DataSource
Class Inheritance
All Implemented Interfaces
jakarta.activation.DataSource
Imports
jakarta.activation.DataSource, java.io.ByteArrayInputStream, .ByteArrayOutputStream, .InputStreamReader

INTERNAL:
Author
mmacivor

Field Summary

Modifier and TypeField and Description
pack-priv byte[]
pack-priv String

Constructor Summary

AccessConstructor and Description
public
ByteArrayDataSource(byte[] data, String mimeType)

Method Summary

Modifier and TypeMethod and Description
public String
getContentType()

Implements jakarta.activation.DataSource.getContentType.

This method returns the MIME type of the data in the form of a string.
public InputStream
getInputStream()

Implements jakarta.activation.DataSource.getInputStream.

This method returns an InputStream representing the data and throws the appropriate exception if it can not do so.
public String
getName()

Implements jakarta.activation.DataSource.getName.

Return the name of this object where the name of the object is dependant on the nature of the underlying objects.
public OutputStream
getOutputStream()

Implements jakarta.activation.DataSource.getOutputStream.

This method returns an OutputStream where the data can be written and throws the appropriate exception if it can not do so.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bytesback to summary
pack-priv byte[] bytes
contentTypeback to summary
pack-priv String contentType

Constructor Detail

ByteArrayDataSourceback to summary
public ByteArrayDataSource(byte[] data, String mimeType)

Method Detail

getContentTypeback to summary
public String getContentType()

Implements jakarta.activation.DataSource.getContentType.

Doc from jakarta.activation.DataSource.getContentType.

This method returns the MIME type of the data in the form of a string. It should always return a valid type. It is suggested that getContentType return "application/octet-stream" if the DataSource implementation can not determine the data type.

Returns:String

the MIME Type

Annotations
@Override
getInputStreamback to summary
public InputStream getInputStream()

Implements jakarta.activation.DataSource.getInputStream.

Doc from jakarta.activation.DataSource.getInputStream.

This method returns an InputStream representing the data and throws the appropriate exception if it can not do so. Note that a new InputStream object must be returned each time this method is called, and the stream must be positioned at the beginning of the data.

Returns:InputStream

an InputStream

Annotations
@Override
getNameback to summary
public String getName()

Implements jakarta.activation.DataSource.getName.

Doc from jakarta.activation.DataSource.getName.

Return the name of this object where the name of the object is dependant on the nature of the underlying objects. DataSources encapsulating files may choose to return the filename of the object. (Typically this would be the last component of the filename, not an entire pathname.)

Returns:String

the name of the object.

Annotations
@Override
getOutputStreamback to summary
public OutputStream getOutputStream()

Implements jakarta.activation.DataSource.getOutputStream.

Doc from jakarta.activation.DataSource.getOutputStream.

This method returns an OutputStream where the data can be written and throws the appropriate exception if it can not do so. Note that a new OutputStream object must be returned each time this method is called, and the stream must be positioned at the location the data is to be written.

Returns:OutputStream

an OutputStream

Annotations
@Override