public class

ByteArrayDataSource

extends Object
implements DataSource
java.lang.Object
   ↳ com.priint.comet.renderer.io.ByteArrayDataSource

Class Overview

Class responsible for ByteArrayDataSource

Summary

Public Constructors
ByteArrayDataSource()
default empty constructor
ByteArrayDataSource(String contentType, String name, byte[] data)
constructor
ByteArrayDataSource(String contentType, String name, String data)
constructor
ByteArrayDataSource(byte[] data)
constructor.
Public Methods
String getContentType()
byte[] getData()
InputStream getInputStream()
String getName()
OutputStream getOutputStream()
void setContentType(String contentType)
set the content type of the ByteArrayDataSource
void setData(byte[] data)
set the data for the ByteArrayDataSource
void setName(String name)
set the name for the ByteArrayDataSource
[Expand]
Inherited Methods
From class java.lang.Object
From interface javax.activation.DataSource

Public Constructors

public ByteArrayDataSource ()

default empty constructor

public ByteArrayDataSource (String contentType, String name, byte[] data)

constructor

Parameters
contentType type of content to be created
name name of the ByteArrayDataSource to be created
data data provided as byte[]

public ByteArrayDataSource (String contentType, String name, String data)

constructor

Parameters
contentType type of content to be created
name name of the ByteArrayDataSource to be created
data data provided as String

public ByteArrayDataSource (byte[] data)

constructor. Content type is automatically set to "application/text". Name is set to "String"

Parameters
data data provided as byte[] to be included.

Public Methods

public String getContentType ()

Returns
  • content type as String

public byte[] getData ()

Returns
  • data as byte[]

public InputStream getInputStream ()

Returns
  • ByteArrayInputStream
Throws
IOException

public String getName ()

Returns
  • name as String

public OutputStream getOutputStream ()

Returns
  • ByteArrayOutputStream
Throws
IOException

public void setContentType (String contentType)

set the content type of the ByteArrayDataSource

Parameters
contentType as String

public void setData (byte[] data)

set the data for the ByteArrayDataSource

Parameters
data as byte[]

public void setName (String name)

set the name for the ByteArrayDataSource

Parameters
name as String