|
Berkeley DB version 4.2.52 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.sleepycat.db.Dbt
|
+--com.sleepycat.bdb.DataThang
(internal) An extension of a Berkeley DB thang (Dbt) that supports
the DataBuffer interface for bindings and other added utilities.
NOTE: This classes is internal and may be changed incompatibly or deleted in the future. It is public only so it may be used by subpackages.
| Constructor Summary | |
DataThang()
Creates a thang with no data. |
|
DataThang(byte[] bytes)
Creates a thang containing the given data data. |
|
DataThang(DataThang copyFrom)
Creates a thang with a copy of the data from the given thang. |
|
| Method Summary | |
void |
clearDataFormation()
Sets the formation associated with the data in this buffer to null. |
int |
compareTo(Dbt key2)
Returns -1 if the byte array of this thang is less than that of the given thang, 0 if they are equal, or 1 if greater. |
void |
copy(DataThang copyFrom)
Copies the data from the given thang to this thang.. |
static void |
dump(Dbt dbt,
PrintStream out)
Prints the byte array of the given thing to the given stream using toString() to convert the bytes to a string. |
void |
dump(PrintStream out)
Prints the byte array of this thing to the given stream using toString() to convert the bytes to a string. |
boolean |
equals(Dbt other)
Returns whether the byte array of this thang is equal to that of the given thang. |
byte[] |
getBytes()
Returns the data for this thang. |
ByteArrayInputStream |
getByteStream()
Returns the data for this thang as a byte array input stream.. |
byte[] |
getDataBytes()
Returns the byte array of the data buffer. |
Object |
getDataFormation()
Returns the formation associated with the data in this buffer. |
int |
getDataLength()
Returns the byte length of the data in the array. |
int |
getDataOffset()
Returns the byte offset of the data in the array. |
void |
increment()
Increments the data value for this thang, treating the byte array as a Java BigInteger where the bytes are in MSB-first order. |
void |
setBytes(byte[] bytes)
Sets the data for this thang. |
void |
setBytes(byte[] bytes,
int offset,
int length)
Sets the data for this thang. |
void |
setData(byte[] data,
int offset,
int length)
Sets the data in this buffer to the given value. |
void |
setDataFormation(Object formation)
Sets the formation associated with the data in this buffer. |
String |
toString()
Converts the byte array of this thang to space-separated integers, and suffixed by the record number if applicable. |
static String |
toString(Dbt dbt)
Converts the byte array of this thang to space-separated integers, and suffixed by the record number if applicable. |
| Methods inherited from class com.sleepycat.db.Dbt |
get_data, get_dlen, get_doff, get_flags, get_object, get_offset, get_recno_key_data, get_size, get_ulen, getData, getFlags, getObject, getOffset, getPartialLength, getPartialOffset, getRecordNumber, getSize, getUserBufferLength, set_data, set_dlen, set_doff, set_flags, set_object, set_offset, set_recno_key_data, set_size, set_ulen, setData, setFlags, setObject, setOffset, setPartialLength, setPartialOffset, setRecordNumber, setSize, setUserBufferLength |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DataThang()
public DataThang(byte[] bytes)
bytes - the initial data.public DataThang(DataThang copyFrom)
copyFrom - a data thang to clone.| Method Detail |
public void copy(DataThang copyFrom)
copyFrom - a data thang to clone.public void setBytes(byte[] bytes)
bytes - the new data.
public void setBytes(byte[] bytes,
int offset,
int length)
bytes - the new data.offset - the new data offset.length - the new data length.public byte[] getBytes()
public ByteArrayInputStream getByteStream()
public void increment()
public int compareTo(Dbt key2)
key2 - the key to compare.
public boolean equals(Dbt other)
other - the thang to compare.
public void dump(PrintStream out)
out - the stream to write to.
public static void dump(Dbt dbt,
PrintStream out)
dbt - the data thang to dump.out - the stream to write to.public static String toString(Dbt dbt)
dbt - the thang to convert.public String toString()
toString in class Object
public void setData(byte[] data,
int offset,
int length)
DataBuffer
setData in interface DataBufferdata - is the data array and must not be modified after this
method is called.offset - is the byte offset of the data in the array.length - is the byte length of the data in the array.public byte[] getDataBytes()
DataBuffer
getDataBytes in interface DataBufferpublic int getDataOffset()
DataBuffer
getDataOffset in interface DataBufferpublic int getDataLength()
DataBuffer
getDataLength in interface DataBufferpublic void setDataFormation(Object formation)
DataBuffer
setDataFormation in interface DataBufferformation - is Object to set.public Object getDataFormation()
DataBuffer
getDataFormation in interface DataBufferpublic void clearDataFormation()
DataBuffer
clearDataFormation in interface DataBuffer
|
Berkeley DB version 4.2.52 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||