Package xal.tools.database
Class ConcreteBlob
java.lang.Object
xal.tools.database.ConcreteBlob
- All Implemented Interfaces:
Blob
Concrete implementation of an SQL Blob.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfree()Get an input stream that can read the BLOB data.getBinaryStream(long position, long length) byte[]getBytes(long position, int length) Get the specified part of the blob data as an array of bytes.longlength()Get the number of bytes in this BLOB.longposition(byte[] pattern, long start) Get the position of the first occurrence of pattern in this BLOB starting at the position specified by start.longGet the position of the first occurrence of pattern in this BLOB starting at the position specified by start.setBinaryStream(long position) Get an output stream for writing to this BLOB.intsetBytes(long position, byte[] bytes) Set the specified bytes.intsetBytes(long position, byte[] bytes, int offset, int length) Set the specified bytes.voidtruncate(long length) Truncate this BLOB to be the specified length.
-
Field Details
-
data
protected byte[] data
-
-
Constructor Details
-
ConcreteBlob
public ConcreteBlob(int capacity) Primary Constructor- Parameters:
capacity- The number of bytes allocated for data storage.
-
ConcreteBlob
public ConcreteBlob()Constructor
-
-
Method Details
-
getBinaryStream
Get an input stream that can read the BLOB data.- Specified by:
getBinaryStreamin interfaceBlob- Throws:
SQLException
-
getBinaryStream
- Specified by:
getBinaryStreamin interfaceBlob
-
free
public void free() -
getBytes
public byte[] getBytes(long position, int length) Get the specified part of the blob data as an array of bytes. -
length
public long length()Get the number of bytes in this BLOB. -
position
Get the position of the first occurrence of pattern in this BLOB starting at the position specified by start.- Specified by:
positionin interfaceBlob- Throws:
SQLException
-
position
public long position(byte[] pattern, long start) Get the position of the first occurrence of pattern in this BLOB starting at the position specified by start. -
setBinaryStream
Get an output stream for writing to this BLOB. This implementation simply throws an unsupported operation exception.- Specified by:
setBinaryStreamin interfaceBlob
-
setBytes
public int setBytes(long position, byte[] bytes, int offset, int length) Set the specified bytes. -
setBytes
public int setBytes(long position, byte[] bytes) Set the specified bytes. -
truncate
public void truncate(long length) Truncate this BLOB to be the specified length.
-