|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sqlite.jdbc.JdbcBlob
public class JdbcBlob
Constructor Summary | |
---|---|
JdbcBlob(Closeable owner,
Blob blob)
Create JdbcBlob object from the sqlite3_blob object. |
|
JdbcBlob(Closeable owner,
SWIGTYPE_p_void blob,
long len)
Create JdbcBlob object from the void pointer. |
Method Summary | |
---|---|
void |
close()
Closes this BLOB object. |
java.io.InputStream |
getBinaryStream()
Retrieves the BLOB value designated by this Blob instance as a stream. |
byte[] |
getBytes(long pos,
int len)
Retrieves all or part of the BLOB value that this Blob object represents, as an array of bytes. |
boolean |
isClosed()
Retrieves whether this BLOB object has been closed. |
long |
length()
Returns the number of bytes in the BLOB value designated by this Blob object. |
long |
position(java.sql.Blob pattern,
long start)
invoke position(byte[], long) method. |
long |
position(byte[] pattern,
long start)
Retrieves by the Boyer-Moore algorithm. |
java.io.OutputStream |
setBinaryStream(long pos)
Retrieves a stream that can be used to write to the BLOB value that this Blob object represents. |
int |
setBytes(long pos,
byte[] bytes)
Writes the given array of bytes to the BLOB value that this Blob object represents, starting at position pos, and returns the number of bytes written. |
int |
setBytes(long pos,
byte[] bytes,
int offset,
int len)
Writes all or part of the given byte array to the BLOB value that this Blob object represents and returns the number of bytes written. |
void |
truncate(long len)
Not supporetd yet. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JdbcBlob(Closeable owner, SWIGTYPE_p_void blob, long len)
owner
- the owner Closeable objectblob
- the pointer of bloblen
- the number of bytespublic JdbcBlob(Closeable owner, Blob blob) throws java.sql.SQLException
owner
- the owner Closeable objectblob
- the sqlite3_blob object
java.sql.SQLException
- When this method is called on a closed blob.Method Detail |
---|
public long length()
length
in interface java.sql.Blob
public byte[] getBytes(long pos, int len) throws java.sql.SQLException
getBytes
in interface java.sql.Blob
pos
- the ordinal position of the first byte in the BLOB value to be extracted; the first byte is at position 1len
- the number of consecutive bytes to be copied; the value for length must be 0 or greater
java.sql.SQLException
- When this method is called on a closed connection. When pos is less than 1 or length is less than 0public java.io.InputStream getBinaryStream() throws java.sql.SQLException
getBinaryStream
in interface java.sql.Blob
java.sql.SQLException
public long position(byte[] pattern, long start) throws java.sql.SQLException
position
in interface java.sql.Blob
pattern
- the byte array for which to searchstart
- the position at which to begin searching; the first position is 1
java.sql.SQLException
- When this method is called on a closed connection.getBytes(long, int)
public long position(java.sql.Blob pattern, long start) throws java.sql.SQLException
position
in interface java.sql.Blob
pattern
- the Blob object designating the BLOB value for which to searchstart
- the position in the BLOB value at which to begin searching; the first position is 1
java.sql.SQLException
- When this method is called on a closed connection.position(byte[], long)
public int setBytes(long pos, byte[] bytes) throws java.sql.SQLException
setBytes
in interface java.sql.Blob
pos
- the position in the BLOB object at which to start writing; the first position is 1bytes
- the array of bytes to be written to the BLOB value that this Blob object represents
java.sql.SQLException
setBytes(long, byte[], int, int)
public int setBytes(long pos, byte[] bytes, int offset, int len) throws java.sql.SQLException
setBytes
in interface java.sql.Blob
pos
- the position in the BLOB object at which to start writing; the first position is 1bytes
- the array of bytes to be written to this BLOB objectoffset
- the offset into the array bytes at which to start reading the bytes to be setlen
- the number of bytes to be written to the BLOB value from the array of bytes bytes
java.sql.SQLException
setBinaryStream(long)
,
OutputStream.write(byte[], int, int)
public java.io.OutputStream setBinaryStream(long pos) throws java.sql.SQLException
setBinaryStream
in interface java.sql.Blob
pos
- the position in the BLOB value at which to start writing; the first position is 1
java.sql.SQLException
- if there is an error accessing the BLOB value or if pos is less than 1public void truncate(long len)
truncate
in interface java.sql.Blob
java.lang.UnsupportedOperationException
public void close()
close
in interface Closeable
public boolean isClosed()
isClosed
in interface Closeable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |