DbStorage.manager
Class BlobManager

java.lang.Object
  extended byDbStorage.manager.BlobManager

public final class BlobManager
extends java.lang.Object

This class implements the metods to storage BLOB objects.


Constructor Summary
BlobManager()
           
 
Method Summary
static long getLength(DbStorageManager dbsm, long transactionNumber, PhysicalID id)
          Returns the length of the datum.
static int read(DbStorageManager dbsm, long transactionNumber, PhysicalID id, long from, byte[] b)
          Reads from a BLOB datum and stores the readed in a byte array.
static int read(DbStorageManager dbsm, long transactionNumber, PhysicalID id, long from, int maxLength, byte[] b, int off)
          Reads from a BLOB datum and stores the readed in a byte array.
static void setLength(DbStorageManager dbsm, long transactionNumber, PhysicalID id, long newLength)
          Changes the length of the BLOB datum.
static int write(DbStorageManager dbsm, long transactionNumber, PhysicalID id, long from, byte[] b)
          Writes a byte array into a BLOB datum.
static int write(DbStorageManager dbsm, long transactionNumber, PhysicalID id, long from, int maxLength, byte[] b, int off)
          Writes a byte array into a BLOB datum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlobManager

public BlobManager()
Method Detail

setLength

public static void setLength(DbStorageManager dbsm,
                             long transactionNumber,
                             PhysicalID id,
                             long newLength)
                      throws storage.StorageException,
                             java.io.IOException,
                             OutOfLOBException
Changes the length of the BLOB datum.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the datum to resize.
newLength - The new length of the datum.
Throws:
storage.StorageException
java.io.IOException
OutOfLOBException

getLength

public static long getLength(DbStorageManager dbsm,
                             long transactionNumber,
                             PhysicalID id)
                      throws storage.StorageException,
                             java.io.IOException
Returns the length of the datum.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the datum to resize.
Returns:
The length of the datum.
Throws:
storage.StorageException
java.io.IOException

write

public static int write(DbStorageManager dbsm,
                        long transactionNumber,
                        PhysicalID id,
                        long from,
                        int maxLength,
                        byte[] b,
                        int off)
                 throws storage.StorageException,
                        java.io.IOException,
                        OutOfLOBException
Writes a byte array into a BLOB datum.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the datum to wrote.
from - The position of the BLOB from which the witting starts.
maxLength - The maximum number of bytes to write.
b - The array contains the bytes to write.
off - The offset of b from which the bytes are retrieved.
Returns:
The number of written bytes.
Throws:
storage.StorageException
java.io.IOException
OutOfLOBException

write

public static int write(DbStorageManager dbsm,
                        long transactionNumber,
                        PhysicalID id,
                        long from,
                        byte[] b)
                 throws storage.StorageException,
                        java.io.IOException,
                        OutOfLOBException
Writes a byte array into a BLOB datum.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the datum to wrote.
from - The position of the BLOB from which the witting starts.
b - The array contains the bytes to write.
Returns:
The number of written bytes.
Throws:
storage.StorageException
java.io.IOException
OutOfLOBException

read

public static int read(DbStorageManager dbsm,
                       long transactionNumber,
                       PhysicalID id,
                       long from,
                       int maxLength,
                       byte[] b,
                       int off)
                throws storage.StorageException,
                       java.io.IOException,
                       OutOfLOBException
Reads from a BLOB datum and stores the readed in a byte array.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the datum to read.
from - The position of the BLOB from which the reading starts.
maxLength - The maximum number of bytes to read.
b - The array where the readed bytes will be stored.
off - The offset of b from which the readed bytes are stored.
Returns:
The number of readed bytes.
Throws:
storage.StorageException
java.io.IOException
OutOfLOBException

read

public static int read(DbStorageManager dbsm,
                       long transactionNumber,
                       PhysicalID id,
                       long from,
                       byte[] b)
                throws storage.StorageException,
                       java.io.IOException,
                       OutOfLOBException
Reads from a BLOB datum and stores the readed in a byte array.

Parameters:
dbsm - The data base storage manager where the operation will be performed.
transactionNumber - The number of transaction.
id - The identifier of the datum to read.
from - The position of the BLOB from which the reading starts.
b - The array where the readed bytes will be stored.
Returns:
The number of readed bytes.
Throws:
storage.StorageException
java.io.IOException
OutOfLOBException