|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mguennewig.pobjects.PObjBlob
public class PObjBlob
This class provides a portable way to create a BLOB.
NOTE: This class is only suitable to create a BLOB to put data into the database. You will get back a database specific BLOB when reading.
BlobType| Field Summary | |
|---|---|
static java.sql.Blob |
EMPTY_BLOB
An empty unmodifiable BLOB. |
| Constructor Summary | |
|---|---|
PObjBlob()
Creates a new empty BLOB. |
|
PObjBlob(byte[] data)
Creates a new BLOB for the given data. |
|
PObjBlob(java.io.File file)
Creates a new BLOB that uses the specified file for the data. |
|
| Method Summary | |
|---|---|
void |
free()
|
java.io.InputStream |
getBinaryStream()
Retrieves the BLOB value designated by this Blob instance as a stream. |
java.io.InputStream |
getBinaryStream(long pos,
long length)
|
byte[] |
getBytes(long pos,
int length)
Retrieves all or part of the BLOB value that this Blob object represents, as an array of bytes. |
long |
length()
Returns the number of bytes in the BLOB value designated by this Blob object. |
long |
position(java.sql.Blob pattern,
long start)
Retrieves the byte position in the BLOB value designated by this Blob object at which pattern begins. |
long |
position(byte[] pattern,
long start)
Retrieves the byte position at which the specified byte array pattern begins within the BLOB value that this Blob object represents. |
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)
Truncates the BLOB value that this Blob object represents to be len bytes in length. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.sql.Blob EMPTY_BLOB
| Constructor Detail |
|---|
public PObjBlob()
public PObjBlob(byte[] data)
public PObjBlob(java.io.File file)
| Method Detail |
|---|
public java.io.InputStream getBinaryStream()
throws java.sql.SQLException
getBinaryStream in interface java.sql.Blobjava.sql.SQLException
public byte[] getBytes(long pos,
int length)
throws java.sql.SQLException
getBytes in interface java.sql.Blobjava.sql.SQLExceptionpublic long length()
length in interface java.sql.Blob
public long position(java.sql.Blob pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobjava.sql.SQLException
public long position(byte[] pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobjava.sql.SQLExceptionpublic java.io.OutputStream setBinaryStream(long pos)
setBinaryStream in interface java.sql.Blob
public final int setBytes(long pos,
byte[] bytes)
setBytes in interface java.sql.Blob
public int setBytes(long pos,
byte[] bytes,
int offset,
int len)
setBytes in interface java.sql.Blobpublic void truncate(long len)
truncate in interface java.sql.Blobpublic void free()
free in interface java.sql.Blob
public java.io.InputStream getBinaryStream(long pos,
long length)
throws java.sql.SQLException
getBinaryStream in interface java.sql.Blobjava.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||