Package com.sleepycat.db
Class MultipleEntry
java.lang.Object
com.sleepycat.db.DatabaseEntry
com.sleepycat.db.MultipleEntry
- Direct Known Subclasses:
MultipleDataEntry,MultipleKeyDataEntry,MultipleKeyNIODataEntry,MultipleNIODataEntry,MultipleRecnoDataEntry,MultipleRecnoNIODataEntry
An abstract class representing a DatabaseEntry that holds multiple results
returned by a single
Cursor get method. Use one of the concrete
subclasses depending on whether you need:
- multiple data items only:
MultipleDataEntry - multiple key / data item pairs:
MultipleKeyDataEntry - multiple record number / data item pairs:
MultipleRecnoDataEntry
-
Method Summary
Modifier and TypeMethodDescriptionprotected booleanappend_internal(byte[] newdata, int offset, int len) protected booleanappend_internal(byte[] newdata, int offset, int len, int recno) voidsetUserBuffer(int length, boolean usermem) Configures the entry with an application-owned buffer.Methods inherited from class com.sleepycat.db.DatabaseEntry
equals, getData, getDataNIO, getOffset, getPartial, getPartialLength, getPartialOffset, getReadOnly, getRecordNumber, getReuseBuffer, getSize, getUserBuffer, getUserBufferLength, hashCode, setData, setData, setDataNIO, setDataNIO, setOffset, setPartial, setPartial, setPartialLength, setPartialOffset, setReadOnly, setRecordNumber, setReuseBuffer, setSize
-
Method Details
-
setUserBuffer
public void setUserBuffer(int length, boolean usermem) Description copied from class:DatabaseEntryConfigures the entry with an application-owned buffer.The
datafield of the entry must refer to a buffer that is at leastlengthbytes in length.If the length of the requested item is less than or equal to that number of bytes, the item is copied into the memory to which the
datafield refers. Otherwise, thesizefield is set to the length needed for the requested item, and aMemoryExceptionis thrown.Applications can determine the length of a record by setting
lengthto 0 and callingDatabaseEntry.getSizeon the return value.- Overrides:
setUserBufferin classDatabaseEntry- Parameters:
length- the length of the bufferusermem- whether the buffer is owned by the application
-
append_internal
protected boolean append_internal(byte[] newdata, int offset, int len, int recno) throws DatabaseException - Throws:
DatabaseException
-
append_internal
- Throws:
DatabaseException
-