Package org.apache.derby.impl.load
Class ImportBlob
- java.lang.Object
-
- org.apache.derby.impl.load.ImportBlob
-
- All Implemented Interfaces:
java.sql.Blob
class ImportBlob extends java.lang.Object implements java.sql.BlobThis class implementsjava.sql.BLOB interface. Objects created using theImportBlobclass 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 satisfyjava.sql.Blobinterface.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]blobDataprivate longblobLengthprivate longblobPositionprivate ImportLobFilelobFile
-
Constructor Summary
Constructors Constructor Description 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 readslengthamount of data from an external file, starting atposition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfree()Raise error, not used by importjava.io.InputStreamgetBinaryStream()ReturnsBLOBvalue designated by thisBlobobject as a input stream.java.io.InputStreamgetBinaryStream(long pos, long length)Raise error, not used by importbyte[]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.longlength()Returns the number of bytes in thisBLOBobject.private java.sql.SQLExceptionmethodNotImplemented()Return an unimplemented feature errorlongposition(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.longposition(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.java.io.OutputStreamsetBinaryStream(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.intsetBytes(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.intsetBytes(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.voidtruncate(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.
-
-
-
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 readslengthamount of data from an external file, starting atposition.- 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.SQLExceptionReturns the number of bytes in thisBLOBobject.- Specified by:
lengthin interfacejava.sql.Blob- Returns:
- length of the
BLOBin bytes - Throws:
java.sql.SQLException- on any error.
-
getBinaryStream
public java.io.InputStream getBinaryStream() throws java.sql.SQLExceptionReturnsBLOBvalue designated by thisBlobobject as a input stream.- Specified by:
getBinaryStreamin interfacejava.sql.Blob- Returns:
- a stream containing the
BLOBdata - 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.SQLExceptionThis routine is not used by the VTI to read the data, so no implementatio is provided , an exception is thrown if used.- Specified by:
getBytesin interfacejava.sql.Blob- Throws:
java.sql.SQLException- See Also:
Blob
-
position
public long position(byte[] pattern, long start) throws java.sql.SQLExceptionThis routine is not used by the VTI to read the data, so no implementatio is provided , an exception is thrown if used.- Specified by:
positionin interfacejava.sql.Blob- Throws:
java.sql.SQLException- See Also:
Blob
-
position
public long position(java.sql.Blob pattern, long start) throws java.sql.SQLExceptionThis routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.- Specified by:
positionin interfacejava.sql.Blob- Throws:
java.sql.SQLException- See Also:
Blob
-
setBytes
public int setBytes(long pos, byte[] bytes) throws java.sql.SQLExceptionThis routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.- Specified by:
setBytesin interfacejava.sql.Blob- Throws:
java.sql.SQLException- See Also:
Blob
-
setBytes
public int setBytes(long pos, byte[] bytes, int offset, int len) throws java.sql.SQLExceptionThis routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.- Specified by:
setBytesin interfacejava.sql.Blob- Throws:
java.sql.SQLException- See Also:
Blob
-
setBinaryStream
public java.io.OutputStream setBinaryStream(long pos) throws java.sql.SQLExceptionThis routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.- Specified by:
setBinaryStreamin interfacejava.sql.Blob- Throws:
java.sql.SQLException- See Also:
Blob
-
truncate
public void truncate(long len) throws java.sql.SQLExceptionThis routine is not used by the VTI to read the data, so no implementation is provided , an exception is thrown if used.- Specified by:
truncatein interfacejava.sql.Blob- Throws:
java.sql.SQLException- See Also:
Blob
-
getBinaryStream
public java.io.InputStream getBinaryStream(long pos, long length) throws java.sql.SQLExceptionRaise error, not used by import- Specified by:
getBinaryStreamin interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
free
public void free() throws java.sql.SQLExceptionRaise error, not used by import- Specified by:
freein interfacejava.sql.Blob- Throws:
java.sql.SQLException
-
methodNotImplemented
private java.sql.SQLException methodNotImplemented()
Return an unimplemented feature error
-
-