SMILA (incubation) API documentation

org.eclipse.smila.binarystorage.persistence.jpa
Class BinaryStorageDao

java.lang.Object
  extended by org.eclipse.smila.binarystorage.persistence.jpa.BinaryStorageDao
All Implemented Interfaces:
java.io.Serializable

public class BinaryStorageDao
extends java.lang.Object
implements java.io.Serializable

A JPA Entity to store Records.

See Also:
Serialized Form

Constructor Summary
protected BinaryStorageDao()
          Default Constructor, used by JPA.
  BinaryStorageDao(java.lang.String id, byte[] data)
          Conversion Constructor.
  BinaryStorageDao(java.lang.String id, java.io.InputStream input)
          Conversion Constructor.
 
Method Summary
 byte[] getBytes()
          Get the bytes of the binary object.
 java.io.ByteArrayInputStream getBytesAsStream()
          Get the bytes of the binary object as an input stream.
 java.lang.String getId()
          Get the id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryStorageDao

protected BinaryStorageDao()
Default Constructor, used by JPA.


BinaryStorageDao

public BinaryStorageDao(java.lang.String id,
                        byte[] data)
Conversion Constructor. Converts an id and byte array into a BinaryStorageDao object.

Parameters:
id - the id of the binary data
data - the binary data

BinaryStorageDao

public BinaryStorageDao(java.lang.String id,
                        java.io.InputStream input)
                 throws java.io.IOException
Conversion Constructor. Converts an id and InputStream into a BinaryStorageDao object.

Parameters:
id - the id of the data
input - InputStream of the binary data
Throws:
java.io.IOException - if any error occurs
Method Detail

getId

public java.lang.String getId()
Get the id.

Returns:
the id.

getBytes

public byte[] getBytes()
Get the bytes of the binary object.

Returns:
the bytes

getBytesAsStream

public java.io.ByteArrayInputStream getBytesAsStream()
Get the bytes of the binary object as an input stream.

Returns:
the ByteArrayInputStream

SMILA (incubation) API documentation