org.eclipse.datatools.connectivity.oda.consumer.helper
Class OdaBlob

java.lang.Object
  extended byorg.eclipse.datatools.connectivity.oda.consumer.helper.OdaObject
      extended byorg.eclipse.datatools.connectivity.oda.consumer.helper.OdaDriverObject
          extended byorg.eclipse.datatools.connectivity.oda.consumer.helper.OdaBlob
All Implemented Interfaces:
IBlob

public class OdaBlob
extends org.eclipse.datatools.connectivity.oda.consumer.helper.OdaDriverObject
implements IBlob

OdaBlob is the Oda wrapper for Blobs.


Method Summary
 java.lang.Object findAndInvokeMethod(java.lang.String methodName, java.lang.Class[] parameterTypes, java.lang.Object[] args)
           
 java.io.InputStream getBinaryStream()
          Retrieves the BLOB value designated by this IBlob instance as a binary stream of uninterpreted bytes.
 byte[] getBytes(long position, int length)
          Retrieves all or part of the BLOB value designated by this IBlob instance as an array of bytes.
 long length()
          Returns the number of bytes in the BLOB value designated by this IBlob object.
static void setThrowAndSetOdaException()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBinaryStream

public java.io.InputStream getBinaryStream()
                                    throws OdaException
Description copied from interface: IBlob
Retrieves the BLOB value designated by this IBlob instance as a binary stream of uninterpreted bytes.

Specified by:
getBinaryStream in interface IBlob
Returns:
a Java input stream that delivers the BLOB data as a stream of uninterpreted bytes
Throws:
OdaException - if data source error occurs

getBytes

public byte[] getBytes(long position,
                       int length)
                throws OdaException
Description copied from interface: IBlob
Retrieves all or part of the BLOB value designated by this IBlob instance as an array of bytes.
An optional short-cut method to retrieve from the instance's binary stream. The ODA consumer helper framework provides default implementation, which is used when an ODA driver throws an UnsupportedOperationException. An ODA driver is however encouraged to provide a more efficient implementation of this method.

Specified by:
getBytes in interface IBlob
Parameters:
position - the 1-based ordinal position of the first byte in the BLOB value to be extracted
length - the number of consecutive bytes to be copied
Returns:
a byte array containing up to length consecutive bytes from the BLOB value, starting with the byte at position
Throws:
OdaException - if data source error occurs

length

public long length()
            throws OdaException
Description copied from interface: IBlob
Returns the number of bytes in the BLOB value designated by this IBlob object. An optional method; throws UnsupportedOperationException if a driver does not support retrieving the length.

Specified by:
length in interface IBlob
Returns:
length of the BLOB value in bytes
Throws:
OdaException - if data source error occurs

setThrowAndSetOdaException

public static void setThrowAndSetOdaException()

findAndInvokeMethod

public java.lang.Object findAndInvokeMethod(java.lang.String methodName,
                                            java.lang.Class[] parameterTypes,
                                            java.lang.Object[] args)
                                     throws java.lang.NoSuchMethodException,
                                            java.lang.IllegalAccessException,
                                            java.lang.reflect.InvocationTargetException,
                                            OdaException
Throws:
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
OdaException


Copyright © 2005 Actuate Corp. All rights reserved.