org.apache.derby.impl.load
Class ImportBlob

java.lang.Object
  extended by org.apache.derby.impl.load.ImportBlob
All Implemented Interfaces:
java.sql.Blob

 class ImportBlob
extends java.lang.Object
implements java.sql.Blob

This class implements java.sql.BLOB interface . Objects created using the ImportBlob class are intended to be be used to create a blob object of the data stored in an import file or as an hex string. Only the routines that are needed read the blob data for the blob columns by the inserts done through the VTI have real implementations, Other routines are dummy ones to satisfy java.sql.Blob interface.


Field Summary
private  byte[] blobData
           
private  long blobLength
           
private  long blobPosition
           
private  ImportLobFile lobFile
           
 
Constructor Summary
ImportBlob(byte[] data)
          Create a import Blob object, whose value is the give hex data string.
ImportBlob(ImportLobFile lobFile, long position, long length)
          Create a import Blob object, that reads length amount of data from an external file, starting at position .
 
Method Summary
 java.io.InputStream getBinaryStream()
          Returns BLOB value designated by this Blob object as a input stream.
 byte[] getBytes(long pos, int length)
          This routine is not used by the VTI to read the data, so no implementatio is provided , an exception is thrown if used.
 long length()
          Returns the number of bytes in this BLOB object.
 long position(java.sql.Blob pattern, long start)
          This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.
 long position(byte[] pattern, long start)
          This routine is not used by the VTI to read the data, so no implementatio is provided , an exception is thrown if used.
 java.io.OutputStream setBinaryStream(long pos)
          This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.
 int setBytes(long pos, byte[] bytes)
          This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.
 int setBytes(long pos, byte[] bytes, int offset, int len)
          This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.
 void truncate(long len)
          This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.Blob
free, getBinaryStream
 

Field Detail

lobFile

private ImportLobFile lobFile

blobPosition

private long blobPosition

blobLength

private long blobLength

blobData

private byte[] blobData
Constructor Detail

ImportBlob

public ImportBlob(ImportLobFile lobFile,
                  long position,
                  long length)
Create a import Blob object, that reads length amount of data from an external file, starting at position .

Parameters:
lobFile - lob file resource object, using which data is read.
position - byte offset in the file, of this blob columb data.
length - length of this blob object data.

ImportBlob

public ImportBlob(byte[] data)
Create a import Blob object, whose value is the give hex data string.

Parameters:
data - byte array that contains the blob data.
Method Detail

length

public long length()
            throws java.sql.SQLException
Returns the number of bytes in this BLOB object.

Specified by:
length in interface java.sql.Blob
Returns:
length of the BLOB in bytes
Throws:
java.sql.SQLException - on any error.

getBinaryStream

public java.io.InputStream getBinaryStream()
                                    throws java.sql.SQLException
Returns BLOB value designated by this Blob object as a input stream.

Specified by:
getBinaryStream in interface java.sql.Blob
Returns:
a stream containing the BLOB data
Throws:
java.sql.SQLException - if any error occurs while setting up this blob data in the import file as stream.

getBytes

public byte[] getBytes(long pos,
                       int length)
                throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementatio is provided , an exception is thrown if used.

Specified by:
getBytes in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob

position

public long position(byte[] pattern,
                     long start)
              throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementatio is provided , an exception is thrown if used.

Specified by:
position in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob

position

public long position(java.sql.Blob pattern,
                     long start)
              throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.

Specified by:
position in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob

setBytes

public int setBytes(long pos,
                    byte[] bytes)
             throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.

Specified by:
setBytes in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob

setBytes

public int setBytes(long pos,
                    byte[] bytes,
                    int offset,
                    int len)
             throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.

Specified by:
setBytes in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob

setBinaryStream

public java.io.OutputStream setBinaryStream(long pos)
                                     throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.

Specified by:
setBinaryStream in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob

truncate

public void truncate(long len)
              throws java.sql.SQLException
This routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.

Specified by:
truncate in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.