|
|||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.northgateis.reality.realsql
Class RealSQLBlob
java.lang.Object | +--com.northgateis.reality.realsql.RealSQLBlob
- public class RealSQLBlob
- extends java.lang.Object
- implements java.sql.Blob
- extends java.lang.Object
Implements the JDBC 2.0 Blob
interface.
Constructor Summary | |
RealSQLBlob(byte[] b)
Constructs a new RealSQLBlob from the specified byte array. |
|
RealSQLBlob(java.io.InputStream is)
Constructs a new RealSQLBlob from a binary stream. |
Method Summary | |
java.io.InputStream | getBinaryStream() |
byte[] | getBytes(long pos,
int len) Provides a byte array of data from this Blob
starting at the specified start position within this Blob
and having the specified length. |
long | length() |
long | position(java.sql.Blob pattern,
long start) Provides the position of the first occurrence of the specified pattern after the specified start position. |
long | position(byte[] pattern,
long start) Provides the position of the first occurrence of the specified pattern after the specified start position. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
RealSQLBlob
public RealSQLBlob(byte[] b)
- Constructs a new
RealSQLBlob
from the specified byte array.- Parameters:
b
- the array of bytes thisBlob
represents
RealSQLBlob
public RealSQLBlob(java.io.InputStream is) throws java.sql.SQLException
- Constructs a new
RealSQLBlob
from a binary stream.- Parameters:
is
- the stream from which thisBlob
will be created- Throws:
- java.sql.SQLException - a database error occurred
Method Detail |
getBinaryStream
public java.io.InputStream getBinaryStream() throws java.sql.SQLException
- Specified by:
- getBinaryStream in interface java.sql.Blob
- Returns:
- the
Blob
as anInputStream
- Throws:
- java.sql.SQLException - could not construct the input stream
getBytes
public byte[] getBytes(long pos, int len) throws java.sql.SQLException
- Provides a byte array of data from this
Blob
starting at the specified start position within thisBlob
and having the specified length. Note that the first argument is along
as required by the JDBC 2.0 specification.- Specified by:
- getBytes in interface java.sql.Blob
- Parameters:
pos
- the start positionlen
- the length of the desired return array- Returns:
- an array of the bytes of this
Blob
from the specified start position up to the specified length - Throws:
- java.sql.SQLException - the position argument was greater
than the size of the
Blob
.
length
public long length() throws java.sql.SQLException
- Specified by:
- length in interface java.sql.Blob
- Returns:
- the number of bytes in this
Blob
- Throws:
- java.sql.SQLException -
position
public long position(java.sql.Blob pattern, long start) throws java.sql.SQLException
- Provides the position of the first occurrence of the specified pattern
after the specified start position.
- Specified by:
- position in interface java.sql.Blob
- Parameters:
pattern
- aBlob
representing the desired patternstart
- the index from which to start the search measured from 1- Returns:
- the index of the first occurrence of the specified pattern or -1 if the pattern does not occur
- Throws:
- java.sql.SQLException -
position
public long position(byte[] pattern, long start) throws java.sql.SQLException
- Provides the position of the first occurrence of the specified pattern
after the specified start position.
- Specified by:
- position in interface java.sql.Blob
- Parameters:
pattern
- a byte array representing the desired patternstart
- the index from which to start the search measured from 1- Returns:
- the index of the first occurrence of the specified pattern or -1 if the pattern does not occur
- Throws:
- java.sql.SQLException -
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |