public class HarmonySerialBlob
extends java.lang.Object
implements java.sql.Blob, java.io.Serializable, java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
private java.sql.Blob |
blob |
private byte[] |
buf |
private long |
len |
private long |
origLen |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
HarmonySerialBlob(java.sql.Blob blob)
Constructs an instance by the given
blob |
HarmonySerialBlob(byte[] buf)
Constructs an instance by the given
buf |
| Modifier and Type | Method and Description |
|---|---|
void |
free() |
java.io.InputStream |
getBinaryStream()
Returns an input stream of this SerialObject.
|
java.io.InputStream |
getBinaryStream(long pos,
long length) |
byte[] |
getBytes(long pos,
int length)
Returns a copied array of this SerialObject, starting at the
pos with the given length number. |
long |
length()
Gets the number of bytes in this SerialBlob object.
|
static java.sql.SQLException |
makeSQLException(java.lang.String messageID,
java.lang.Object[] args)
Create a SQLException from Derby message arguments.
|
private boolean |
match(byte[] bytes,
int start,
byte[] subBytes) |
long |
position(java.sql.Blob pattern,
long start)
Search for the position in this Blob at which a specified pattern begins,
starting at a specified position within the Blob.
|
long |
position(byte[] pattern,
long start)
Search for the position in this Blob at which the specified pattern
begins, starting at a specified position within the Blob.
|
java.io.OutputStream |
setBinaryStream(long pos) |
int |
setBytes(long pos,
byte[] theBytes) |
int |
setBytes(long pos,
byte[] theBytes,
int offset,
int length) |
void |
truncate(long length) |
private static final long serialVersionUID
private byte[] buf
private java.sql.Blob blob
private long len
private long origLen
public HarmonySerialBlob(java.sql.Blob blob)
throws java.sql.SQLException
blobblob - the given blobjava.sql.SQLException - if an error is encountered during serialization, or
if blob is nullpublic HarmonySerialBlob(byte[] buf)
bufbuf - the given bufferjava.sql.SQLException - if an error is encountered during serialization, or
if a SQL error is encounteredpublic java.io.InputStream getBinaryStream()
throws java.sql.SQLException
getBinaryStream in interface java.sql.Blobjava.sql.SQLException - if an error is encounteredpublic byte[] getBytes(long pos,
int length)
throws java.sql.SQLException
pos with the given length number. If
pos + length - 1 is larger than the length
of this SerialObject array, the length will be shortened
to the length of array - pos + 1.getBytes in interface java.sql.Blobpos - the starting position of the array to be copied.length - the total length of bytes to be copiedjava.sql.SQLException - if an error is encounteredpublic long length()
throws java.sql.SQLException
length in interface java.sql.Blobjava.sql.SQLException - if an error is encoutneredpublic long position(java.sql.Blob pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobpattern - a Blob containing the pattern of data to search for in this
Blobstart - the position within this Blob to start the search, where the
first position in the Blob is 1java.sql.SQLException - if an error occurs accessing the Blob, or
if an error is encounteredpublic long position(byte[] pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobpattern - a byte array containing the pattern of data to search for in
this Blobstart - the position within this Blob to start the search, where the
first position in the Blob is 1java.sql.SQLException - if an error is encountered, or
if an error occurs accessing the Blobprivate boolean match(byte[] bytes,
int start,
byte[] subBytes)
public java.io.OutputStream setBinaryStream(long pos)
throws java.sql.SQLException
setBinaryStream in interface java.sql.Blobjava.sql.SQLExceptionpublic int setBytes(long pos,
byte[] theBytes)
throws java.sql.SQLException
setBytes in interface java.sql.Blobjava.sql.SQLExceptionpublic int setBytes(long pos,
byte[] theBytes,
int offset,
int length)
throws java.sql.SQLException
setBytes in interface java.sql.Blobjava.sql.SQLExceptionpublic void truncate(long length)
throws java.sql.SQLException
truncate in interface java.sql.Blobjava.sql.SQLExceptionpublic void free()
throws java.sql.SQLException
free in interface java.sql.Blobjava.sql.SQLExceptionpublic java.io.InputStream getBinaryStream(long pos,
long length)
throws java.sql.SQLException
getBinaryStream in interface java.sql.Blobjava.sql.SQLExceptionpublic static java.sql.SQLException makeSQLException(java.lang.String messageID,
java.lang.Object[] args)
Apache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.