• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/db-4.8.30/docs/java/com/sleepycat/db/
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
5<!-- Generated by javadoc (build 1.6.0_03) on Mon Apr 12 16:25:46 EDT 2010 -->
6<TITLE>
7DatabaseEntry (Oracle - Berkeley DB Java API)
8</TITLE>
9
10<META NAME="date" CONTENT="2010-04-12">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17    if (location.href.indexOf('is-external=true') == -1) {
18        parent.document.title="DatabaseEntry (Oracle - Berkeley DB Java API)";
19    }
20}
21</SCRIPT>
22<NOSCRIPT>
23</NOSCRIPT>
24
25</HEAD>
26
27<BODY BGCOLOR="white" onload="windowTitle();">
28<HR>
29
30
31<!-- ========= START OF TOP NAVBAR ======= -->
32<A NAME="navbar_top"><!-- --></A>
33<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
35<TR>
36<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37<A NAME="navbar_top_firstrow"><!-- --></A>
38<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39  <TR ALIGN="center" VALIGN="top">
40  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DatabaseEntry.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
47  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
48  </TR>
49</TABLE>
50</TD>
51<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
52<b>Berkeley DB</b><br><font size="-1"> version 4.8.30</font></EM>
53</TD>
54</TR>
55
56<TR>
57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58&nbsp;<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD>
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61  <A HREF="../../../index.html?com/sleepycat/db/DatabaseEntry.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="DatabaseEntry.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
63&nbsp;<SCRIPT type="text/javascript">
64  <!--
65  if(window==top) {
66    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
67  }
68  //-->
69</SCRIPT>
70<NOSCRIPT>
71  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
72</NOSCRIPT>
73
74
75</FONT></TD>
76</TR>
77<TR>
78<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
82</TR>
83</TABLE>
84<A NAME="skip-navbar_top"></A>
85<!-- ========= END OF TOP NAVBAR ========= -->
86
87<HR>
88<!-- ======== START OF CLASS DATA ======== -->
89<H2>
90<FONT SIZE="-1">
91com.sleepycat.db</FONT>
92<BR>
93Class DatabaseEntry</H2>
94<PRE>
95<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
96  <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.sleepycat.db.DatabaseEntry</B>
97</PRE>
98<DL>
99<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A></DD>
100</DL>
101<HR>
102<DL>
103<DT><PRE>public class <B>DatabaseEntry</B><DT>extends <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
104</PRE>
105
106<P>
107Encodes database key and data items as a byte array.
108<p>
109Storage and retrieval for the <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A> and <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> methods
110are based on key/data pairs. Both key and data items are represented by
111DatabaseEntry objects.  Key and data byte arrays may refer to arrays of zero
112length up to arrays of essentially unlimited length.
113<p>
114The DatabaseEntry class provides simple access to an underlying object whose
115elements can be examined or changed.  DatabaseEntry objects can be
116subclassed, providing a way to associate with it additional data or
117references to other structures.
118<p>
119Access to DatabaseEntry objects is not re-entrant. In particular, if
120multiple threads simultaneously access the same DatabaseEntry object using
121<A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A> or <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> methods, the results are undefined.
122<p>
123DatabaseEntry objects may be used in conjunction with the object mapping
124support provided in the <A HREF="../../../com/sleepycat/bind/package-summary.html"><CODE>com.sleepycat.bind</CODE></A> package.
125<p>
126<h3>Input and Output Parameters</h3>
127<p>
128DatabaseEntry objects are used for both input data (when writing to a
129database or specifying a search parameter) and output data (when reading
130from a database).  For certain methods, one parameter may be an input
131parameter and another may be an output parameter.  For example, the
132<A HREF="../../../com/sleepycat/db/Database.html#get(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)"><CODE>Database.get(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)</CODE></A> method has an input key parameter and an output
133data parameter.  The documentation for each method describes whether its
134parameters are input or output parameters.
135<p>
136For DatabaseEntry input parameters, the caller is responsible for
137initializing the data array of the DatabaseEntry.  For DatabaseEntry
138output parameters, the method called will initialize the data array.
139<p>
140For DatabaseEntry output parameters, by default the method called will
141reuse the byte array in the DatabaseEntry, if the data returned fits in
142the byte array.  This behavior can be configured with <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setReuseBuffer(boolean)"><CODE>setReuseBuffer(boolean)</CODE></A> or <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setUserBuffer(int, boolean)"><CODE>setUserBuffer(int, boolean)</CODE></A>. If an entry is configured to
143reuse the byte array (the default behavior), the length of the underlying
144byte array should not be used to determine the amount of data returned each
145time the entry is used as an output parameter, rather the <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getSize()"><CODE>getSize()</CODE></A>
146call should be used. If an entry is configured to not reuse the byte array,
147a new array is allocated each time the entry is used as an output parameter,
148 so
149the application can safely keep a reference to the byte array returned
150by <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getData()"><CODE>getData()</CODE></A> without danger that the array will be overwritten in
151a subsequent call.
152<p>
153<h3>Offset and Size Properties</h3>
154<p>
155By default the Offset property is zero and the Size property is the length
156of the byte array.  However, to allow for optimizations involving the
157partial use of a byte array, the Offset and Size may be set to non-default
158values.
159<p>
160For DatabaseEntry output parameters, the Size will always be set to the
161length of the returned data and
162the Offset will always be set to zero.
163<p>
164However, for DatabaseEntry input parameters the Offset and Size are set to
165non-default values by the built-in tuple and serial bindings.  For example,
166with a tuple or serial binding the byte array is grown dynamically as data
167is output, and the Size is set to the number of bytes actually used.  For a
168serial binding, the Offset is set to a non-zero value in order to implement
169an optimization having to do with the serialization stream header.
170<p>
171Therefore, for output DatabaseEntry parameters the application can assume
172that the Offset is zero and the Size is the length of the byte array.
173However, for input DatabaseEntry parameters the application should not make
174this assumption.  In general, it is safest for the application to always
175honor the Size and Offset properties, rather than assuming they have default
176values.
177<p>
178<h3>Partial Offset and Length Properties</h3>
179<p>
180By default the specified data (byte array, offset and size) corresponds to
181the full stored key or data item.  Optionally, the Partial property can be
182set to true, and the PartialOffset and PartialLength properties are used to
183specify the portion of the key or data item to be read or written.  For
184details, see the <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A> method.
185<p>
186Note that the Partial properties are set only by the caller.  They will
187never be set by a Database or Cursor method, nor will they every be set by
188bindings.  Therefore, the application can assume that the Partial properties
189are not set, unless the application itself sets them explicitly.
190<P>
191
192<P>
193<HR>
194
195<P>
196
197<!-- ======== CONSTRUCTOR SUMMARY ======== -->
198
199<A NAME="constructor_summary"><!-- --></A>
200<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
201<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
202<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
203<B>Constructor Summary</B></FONT></TH>
204</TR>
205<TR BGCOLOR="white" CLASS="TableRowColor">
206<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#DatabaseEntry()">DatabaseEntry</A></B>()</CODE>
207
208<BR>
209&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a DatabaseEntry with null data.</TD>
210</TR>
211<TR BGCOLOR="white" CLASS="TableRowColor">
212<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#DatabaseEntry(byte[])">DatabaseEntry</A></B>(byte[]&nbsp;data)</CODE>
213
214<BR>
215&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a DatabaseEntry with a given byte array.</TD>
216</TR>
217<TR BGCOLOR="white" CLASS="TableRowColor">
218<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#DatabaseEntry(byte[], int, int)">DatabaseEntry</A></B>(byte[]&nbsp;data,
219              int&nbsp;offset,
220              int&nbsp;size)</CODE>
221
222<BR>
223&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a DatabaseEntry with a given byte array, offset and size.</TD>
224</TR>
225<TR BGCOLOR="white" CLASS="TableRowColor">
226<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#DatabaseEntry(java.nio.ByteBuffer)">DatabaseEntry</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data)</CODE>
227
228<BR>
229&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a DatabaseEntry with a given native I/O buffer.</TD>
230</TR>
231</TABLE>
232&nbsp;
233<!-- ========== METHOD SUMMARY =========== -->
234
235<A NAME="method_summary"><!-- --></A>
236<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
237<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
238<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
239<B>Method Summary</B></FONT></TH>
240</TR>
241<TR BGCOLOR="white" CLASS="TableRowColor">
242<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
243<CODE>&nbsp;boolean</CODE></FONT></TD>
244<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#equals(java.lang.Object)">equals</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;o)</CODE>
245
246<BR>
247&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compares the data of two entries for byte-by-byte equality.</TD>
248</TR>
249<TR BGCOLOR="white" CLASS="TableRowColor">
250<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
251<CODE>&nbsp;byte[]</CODE></FONT></TD>
252<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getData()">getData</A></B>()</CODE>
253
254<BR>
255&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the byte array.</TD>
256</TR>
257<TR BGCOLOR="white" CLASS="TableRowColor">
258<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
259<CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A></CODE></FONT></TD>
260<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getDataNIO()">getDataNIO</A></B>()</CODE>
261
262<BR>
263&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the java.nio.ByteBuffer.</TD>
264</TR>
265<TR BGCOLOR="white" CLASS="TableRowColor">
266<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
267<CODE>&nbsp;int</CODE></FONT></TD>
268<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getOffset()">getOffset</A></B>()</CODE>
269
270<BR>
271&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the byte offset into the data array.</TD>
272</TR>
273<TR BGCOLOR="white" CLASS="TableRowColor">
274<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
275<CODE>&nbsp;boolean</CODE></FONT></TD>
276<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getPartial()">getPartial</A></B>()</CODE>
277
278<BR>
279&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return whether this DatabaseEntry is configured to read or write partial
280    records.</TD>
281</TR>
282<TR BGCOLOR="white" CLASS="TableRowColor">
283<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
284<CODE>&nbsp;int</CODE></FONT></TD>
285<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getPartialLength()">getPartialLength</A></B>()</CODE>
286
287<BR>
288&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the byte length of the partial record being read or written by
289    the application, in bytes.</TD>
290</TR>
291<TR BGCOLOR="white" CLASS="TableRowColor">
292<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
293<CODE>&nbsp;int</CODE></FONT></TD>
294<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getPartialOffset()">getPartialOffset</A></B>()</CODE>
295
296<BR>
297&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the offset of the partial record being read or written by the
298    application, in bytes.</TD>
299</TR>
300<TR BGCOLOR="white" CLASS="TableRowColor">
301<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
302<CODE>&nbsp;int</CODE></FONT></TD>
303<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getRecordNumber()">getRecordNumber</A></B>()</CODE>
304
305<BR>
306&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the record number encoded in this entry's buffer.</TD>
307</TR>
308<TR BGCOLOR="white" CLASS="TableRowColor">
309<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
310<CODE>&nbsp;boolean</CODE></FONT></TD>
311<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getReuseBuffer()">getReuseBuffer</A></B>()</CODE>
312
313<BR>
314&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return true if the whether the entry is configured to reuse the buffer.</TD>
315</TR>
316<TR BGCOLOR="white" CLASS="TableRowColor">
317<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
318<CODE>&nbsp;int</CODE></FONT></TD>
319<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getSize()">getSize</A></B>()</CODE>
320
321<BR>
322&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the byte size of the data array.</TD>
323</TR>
324<TR BGCOLOR="white" CLASS="TableRowColor">
325<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
326<CODE>&nbsp;boolean</CODE></FONT></TD>
327<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getUserBuffer()">getUserBuffer</A></B>()</CODE>
328
329<BR>
330&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return true if the whether the buffer in this entry is owned by the
331    application.</TD>
332</TR>
333<TR BGCOLOR="white" CLASS="TableRowColor">
334<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
335<CODE>&nbsp;int</CODE></FONT></TD>
336<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getUserBufferLength()">getUserBufferLength</A></B>()</CODE>
337
338<BR>
339&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the length of the application's buffer.</TD>
340</TR>
341<TR BGCOLOR="white" CLASS="TableRowColor">
342<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
343<CODE>&nbsp;int</CODE></FONT></TD>
344<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#hashCode()">hashCode</A></B>()</CODE>
345
346<BR>
347&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a hash code based on the data value.</TD>
348</TR>
349<TR BGCOLOR="white" CLASS="TableRowColor">
350<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
351<CODE>&nbsp;void</CODE></FONT></TD>
352<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setData(byte[])">setData</A></B>(byte[]&nbsp;data)</CODE>
353
354<BR>
355&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the byte array.</TD>
356</TR>
357<TR BGCOLOR="white" CLASS="TableRowColor">
358<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
359<CODE>&nbsp;void</CODE></FONT></TD>
360<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setData(byte[], int, int)">setData</A></B>(byte[]&nbsp;data,
361        int&nbsp;offset,
362        int&nbsp;size)</CODE>
363
364<BR>
365&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the byte array, offset and size.</TD>
366</TR>
367<TR BGCOLOR="white" CLASS="TableRowColor">
368<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
369<CODE>&nbsp;void</CODE></FONT></TD>
370<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setDataNIO(java.nio.ByteBuffer)">setDataNIO</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data)</CODE>
371
372<BR>
373&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the java.nio.ByteBuffer.</TD>
374</TR>
375<TR BGCOLOR="white" CLASS="TableRowColor">
376<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
377<CODE>&nbsp;void</CODE></FONT></TD>
378<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setDataNIO(java.nio.ByteBuffer, int, int)">setDataNIO</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data,
379           int&nbsp;offset,
380           int&nbsp;size)</CODE>
381
382<BR>
383&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the java.nio.ByteBuffer (or the backing array if passed a non-direct
384    ByteBuffer,) offset and size.</TD>
385</TR>
386<TR BGCOLOR="white" CLASS="TableRowColor">
387<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
388<CODE>&nbsp;void</CODE></FONT></TD>
389<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setOffset(int)">setOffset</A></B>(int&nbsp;offset)</CODE>
390
391<BR>
392&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the byte offset into the data array.</TD>
393</TR>
394<TR BGCOLOR="white" CLASS="TableRowColor">
395<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
396<CODE>&nbsp;void</CODE></FONT></TD>
397<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(boolean)">setPartial</A></B>(boolean&nbsp;partial)</CODE>
398
399<BR>
400&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configure this DatabaseEntry to read or write partial records.</TD>
401</TR>
402<TR BGCOLOR="white" CLASS="TableRowColor">
403<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
404<CODE>&nbsp;void</CODE></FONT></TD>
405<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)">setPartial</A></B>(int&nbsp;doff,
406           int&nbsp;dlen,
407           boolean&nbsp;partial)</CODE>
408
409<BR>
410&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures this DatabaseEntry to read or write partial records.</TD>
411</TR>
412<TR BGCOLOR="white" CLASS="TableRowColor">
413<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
414<CODE>&nbsp;void</CODE></FONT></TD>
415<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartialLength(int)">setPartialLength</A></B>(int&nbsp;dlen)</CODE>
416
417<BR>
418&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the byte length of the partial record being read or written by
419    the application, in bytes.</TD>
420</TR>
421<TR BGCOLOR="white" CLASS="TableRowColor">
422<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
423<CODE>&nbsp;void</CODE></FONT></TD>
424<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartialOffset(int)">setPartialOffset</A></B>(int&nbsp;doff)</CODE>
425
426<BR>
427&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the offset of the partial record being read or written by the
428    application, in bytes.</TD>
429</TR>
430<TR BGCOLOR="white" CLASS="TableRowColor">
431<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
432<CODE>&nbsp;void</CODE></FONT></TD>
433<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setRecordNumber(int)">setRecordNumber</A></B>(int&nbsp;recno)</CODE>
434
435<BR>
436&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initialize the entry from a logical record number.</TD>
437</TR>
438<TR BGCOLOR="white" CLASS="TableRowColor">
439<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
440<CODE>&nbsp;void</CODE></FONT></TD>
441<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setReuseBuffer(boolean)">setReuseBuffer</A></B>(boolean&nbsp;reuse)</CODE>
442
443<BR>
444&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures the entry to try to reuse the buffer before allocating a new
445    one.</TD>
446</TR>
447<TR BGCOLOR="white" CLASS="TableRowColor">
448<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
449<CODE>&nbsp;void</CODE></FONT></TD>
450<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setSize(int)">setSize</A></B>(int&nbsp;size)</CODE>
451
452<BR>
453&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the byte size of the data array.</TD>
454</TR>
455<TR BGCOLOR="white" CLASS="TableRowColor">
456<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
457<CODE>&nbsp;void</CODE></FONT></TD>
458<TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setUserBuffer(int, boolean)">setUserBuffer</A></B>(int&nbsp;length,
459              boolean&nbsp;usermem)</CODE>
460
461<BR>
462&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures the entry with an application-owned buffer.</TD>
463</TR>
464</TABLE>
465&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
466<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
467<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
468<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
469</TR>
470<TR BGCOLOR="white" CLASS="TableRowColor">
471<TD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
472</TR>
473</TABLE>
474&nbsp;
475<P>
476
477<!-- ========= CONSTRUCTOR DETAIL ======== -->
478
479<A NAME="constructor_detail"><!-- --></A>
480<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
481<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
482<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
483<B>Constructor Detail</B></FONT></TH>
484</TR>
485</TABLE>
486
487<A NAME="DatabaseEntry()"><!-- --></A><H3>
488DatabaseEntry</H3>
489<PRE>
490public <B>DatabaseEntry</B>()</PRE>
491<DL>
492<DD>Construct a DatabaseEntry with null data. The offset and size are set to
493    zero.
494<P>
495</DL>
496<HR>
497
498<A NAME="DatabaseEntry(byte[])"><!-- --></A><H3>
499DatabaseEntry</H3>
500<PRE>
501public <B>DatabaseEntry</B>(byte[]&nbsp;data)</PRE>
502<DL>
503<DD>Construct a DatabaseEntry with a given byte array.  The offset is
504    set to zero; the size is set to the length of the array, or to zero if
505    null is passed.
506    <p>
507<P>
508<DL>
509<DT><B>Parameters:</B><DD><CODE>data</CODE> - Byte array wrapped by the DatabaseEntry.</DL>
510</DL>
511<HR>
512
513<A NAME="DatabaseEntry(byte[], int, int)"><!-- --></A><H3>
514DatabaseEntry</H3>
515<PRE>
516public <B>DatabaseEntry</B>(byte[]&nbsp;data,
517                     int&nbsp;offset,
518                     int&nbsp;size)</PRE>
519<DL>
520<DD>Constructs a DatabaseEntry with a given byte array, offset and size.
521    <p>
522<P>
523<DL>
524<DT><B>Parameters:</B><DD><CODE>data</CODE> - Byte array wrapped by the DatabaseEntry.<DD><CODE>offset</CODE> - Offset in the first byte in the byte array to be included.<DD><CODE>size</CODE> - Number of bytes in the byte array to be included.</DL>
525</DL>
526<HR>
527
528<A NAME="DatabaseEntry(java.nio.ByteBuffer)"><!-- --></A><H3>
529DatabaseEntry</H3>
530<PRE>
531public <B>DatabaseEntry</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data)</PRE>
532<DL>
533<DD>Construct a DatabaseEntry with a given native I/O buffer.  If the buffer is
534    non-direct, the buffer's backing array is used.  If the buffer is direct,
535    the DatabaseEntry is configured with an application-owned buffer whose
536    length is set to the ByteBuffer's capacity less its position.  The
537    DatabaseEntry's size is set to the ByteBuffer's limit less its position and
538    the offset is set to buffer's position (adjusted by arrayOffset if the
539    buffer is non-direct.)
540    <p>
541<P>
542<DL>
543<DT><B>Parameters:</B><DD><CODE>data</CODE> - NIO byte buffer wrapped by the DatabaseEntry.</DL>
544</DL>
545
546<!-- ============ METHOD DETAIL ========== -->
547
548<A NAME="method_detail"><!-- --></A>
549<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
550<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
551<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
552<B>Method Detail</B></FONT></TH>
553</TR>
554</TABLE>
555
556<A NAME="getData()"><!-- --></A><H3>
557getData</H3>
558<PRE>
559public byte[] <B>getData</B>()</PRE>
560<DL>
561<DD>Return the byte array.
562    <p>
563    For a DatabaseEntry that is used as an output parameter, the byte
564    array will always be a newly allocated array.  The byte array specified
565    by the caller will not be used and may be null.
566    <p>
567<P>
568<DD><DL>
569
570<DT><B>Returns:</B><DD>The byte array.</DL>
571</DD>
572</DL>
573<HR>
574
575<A NAME="getDataNIO()"><!-- --></A><H3>
576getDataNIO</H3>
577<PRE>
578public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A> <B>getDataNIO</B>()</PRE>
579<DL>
580<DD>Return the java.nio.ByteBuffer.
581    <p>
582    Used to access the underlying data when the DatabaseEntry is
583    configured to utilize a java.nio.ByteBuffer.
584    <p>
585<P>
586<DD><DL>
587
588<DT><B>Returns:</B><DD>The underlying java.nio.ByteBuffer.</DL>
589</DD>
590</DL>
591<HR>
592
593<A NAME="setData(byte[], int, int)"><!-- --></A><H3>
594setData</H3>
595<PRE>
596public void <B>setData</B>(byte[]&nbsp;data,
597                    int&nbsp;offset,
598                    int&nbsp;size)</PRE>
599<DL>
600<DD>Sets the byte array, offset and size.
601    <p>
602<P>
603<DD><DL>
604<DT><B>Parameters:</B><DD><CODE>data</CODE> - Byte array wrapped by the DatabaseEntry.<DD><CODE>offset</CODE> - Offset in the first byte in the byte array to be included.<DD><CODE>size</CODE> - Number of bytes in the byte array to be included.</DL>
605</DD>
606</DL>
607<HR>
608
609<A NAME="setData(byte[])"><!-- --></A><H3>
610setData</H3>
611<PRE>
612public void <B>setData</B>(byte[]&nbsp;data)</PRE>
613<DL>
614<DD>Sets the byte array.  The offset is set to zero; the size is set to the
615    length of the array, or to zero if null is passed.
616    <p>
617<P>
618<DD><DL>
619<DT><B>Parameters:</B><DD><CODE>data</CODE> - Byte array wrapped by the DatabaseEntry.</DL>
620</DD>
621</DL>
622<HR>
623
624<A NAME="setDataNIO(java.nio.ByteBuffer, int, int)"><!-- --></A><H3>
625setDataNIO</H3>
626<PRE>
627public void <B>setDataNIO</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data,
628                       int&nbsp;offset,
629                       int&nbsp;size)</PRE>
630<DL>
631<DD>Sets the java.nio.ByteBuffer (or the backing array if passed a non-direct
632    ByteBuffer,) offset and size.  If passed a direct ByteBuffer, the entry is
633    configured with an application-owned buffer whose length is set to the 
634    ByteBuffer's capacity less the offset.
635    <p>
636<P>
637<DD><DL>
638<DT><B>Parameters:</B><DD><CODE>data</CODE> - java.nio.ByteBuffer wrapped by the DatabaseEntry.<DD><CODE>offset</CODE> - int offset into the ByteBuffer where the DatabaseEntry data begins.<DD><CODE>size</CODE> - int size of the ByteBuffer available.</DL>
639</DD>
640</DL>
641<HR>
642
643<A NAME="setDataNIO(java.nio.ByteBuffer)"><!-- --></A><H3>
644setDataNIO</H3>
645<PRE>
646public void <B>setDataNIO</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data)</PRE>
647<DL>
648<DD>Sets the java.nio.ByteBuffer.  The offset is set to the ByteBuffer's
649    position; the size is set to the ByteBuffer's limit less its position, or to
650    zero if null is passed.  If the ByteBuffer is non-direct, the backing array
651    will be used.  If passed a direct ByteBuffer, the entry is configured with
652    an application-owned buffer whose length is set to the ByteBuffer's capacity
653    less its current position.  No call to <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setUserBuffer(int, boolean)"><CODE>setUserBuffer(int, boolean)</CODE></A> is required
654    after setting the ByteBuffer.
655    <p>
656<P>
657<DD><DL>
658<DT><B>Parameters:</B><DD><CODE>data</CODE> - java.nio.ByteBuffer wrapped by the DatabaseEntry.</DL>
659</DD>
660</DL>
661<HR>
662
663<A NAME="getOffset()"><!-- --></A><H3>
664getOffset</H3>
665<PRE>
666public int <B>getOffset</B>()</PRE>
667<DL>
668<DD>Return the byte offset into the data array.
669    <p>
670    For a DatabaseEntry that is used as an output parameter, the offset
671    will always be zero.
672    <p>
673<P>
674<DD><DL>
675
676<DT><B>Returns:</B><DD>Offset in the first byte in the byte array to be included.</DL>
677</DD>
678</DL>
679<HR>
680
681<A NAME="setOffset(int)"><!-- --></A><H3>
682setOffset</H3>
683<PRE>
684public void <B>setOffset</B>(int&nbsp;offset)</PRE>
685<DL>
686<DD>Set the byte offset into the data array.
687    <p>
688<P>
689<DD><DL>
690<DT><B>Parameters:</B><DD><CODE>offset</CODE> - Offset in the first byte in the byte array to be included.</DL>
691</DD>
692</DL>
693<HR>
694
695<A NAME="getPartialLength()"><!-- --></A><H3>
696getPartialLength</H3>
697<PRE>
698public int <B>getPartialLength</B>()</PRE>
699<DL>
700<DD>Return the byte length of the partial record being read or written by
701    the application, in bytes.
702    <p>
703    Note that the Partial properties are set only by the caller.  They
704    will never be set by a Database or Cursor method.
705    <p>
706<P>
707<DD><DL>
708
709<DT><B>Returns:</B><DD>The byte length of the partial record being read or written by the
710    application, in bytes.
711    <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A></DL>
712</DD>
713</DL>
714<HR>
715
716<A NAME="getPartialOffset()"><!-- --></A><H3>
717getPartialOffset</H3>
718<PRE>
719public int <B>getPartialOffset</B>()</PRE>
720<DL>
721<DD>Return the offset of the partial record being read or written by the
722    application, in bytes.
723    <p>
724    Note that the Partial properties are set only by the caller.  They
725    will never be set by a Database or Cursor method.
726    <p>
727<P>
728<DD><DL>
729
730<DT><B>Returns:</B><DD>The offset of the partial record being read or written by the
731    application, in bytes.
732    <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A></DL>
733</DD>
734</DL>
735<HR>
736
737<A NAME="getPartial()"><!-- --></A><H3>
738getPartial</H3>
739<PRE>
740public boolean <B>getPartial</B>()</PRE>
741<DL>
742<DD>Return whether this DatabaseEntry is configured to read or write partial
743    records.
744    <p>
745    Note that the Partial properties are set only by the caller.  They
746    will never be set by a Database or Cursor method.
747    <p>
748<P>
749<DD><DL>
750
751<DT><B>Returns:</B><DD>Whether this DatabaseEntry is configured to read or write partial
752    records.
753    <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A></DL>
754</DD>
755</DL>
756<HR>
757
758<A NAME="setPartialOffset(int)"><!-- --></A><H3>
759setPartialOffset</H3>
760<PRE>
761public void <B>setPartialOffset</B>(int&nbsp;doff)</PRE>
762<DL>
763<DD>Set the offset of the partial record being read or written by the
764    application, in bytes.
765    <p>
766    Note that the Partial properties are set only by the caller.  They
767    will never be set by a Database or Cursor method.
768    <p>
769<P>
770<DD><DL>
771<DT><B>Parameters:</B><DD><CODE>doff</CODE> - The offset of the partial record being read or written by the
772    application, in bytes.
773    <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A></DL>
774</DD>
775</DL>
776<HR>
777
778<A NAME="setPartialLength(int)"><!-- --></A><H3>
779setPartialLength</H3>
780<PRE>
781public void <B>setPartialLength</B>(int&nbsp;dlen)</PRE>
782<DL>
783<DD>Set the byte length of the partial record being read or written by
784    the application, in bytes.
785    <p>
786    Note that the Partial properties are set only by the caller.  They
787    will never be set by a Database or Cursor method.
788    <p>
789<P>
790<DD><DL>
791<DT><B>Parameters:</B><DD><CODE>dlen</CODE> - The byte length of the partial record being read or written by the
792    <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>application, in bytes.</CODE></A></DL>
793</DD>
794</DL>
795<HR>
796
797<A NAME="setPartial(boolean)"><!-- --></A><H3>
798setPartial</H3>
799<PRE>
800public void <B>setPartial</B>(boolean&nbsp;partial)</PRE>
801<DL>
802<DD>Configure this DatabaseEntry to read or write partial records.
803    <p>
804    Note that the Partial properties are set only by the caller.  They
805    will never be set by a Database or Cursor method.
806    <p>
807<P>
808<DD><DL>
809<DT><B>Parameters:</B><DD><CODE>partial</CODE> - Whether this DatabaseEntry is configured to read or write partial
810    records.
811    <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A></DL>
812</DD>
813</DL>
814<HR>
815
816<A NAME="setPartial(int, int, boolean)"><!-- --></A><H3>
817setPartial</H3>
818<PRE>
819public void <B>setPartial</B>(int&nbsp;doff,
820                       int&nbsp;dlen,
821                       boolean&nbsp;partial)</PRE>
822<DL>
823<DD>Configures this DatabaseEntry to read or write partial records.
824    <p>
825    Do partial retrieval or storage of an item.  If the calling
826    application is doing a retrieval, length bytes specified by
827    <tt>dlen</tt>, starting at the offset set by <tt>doff</tt> bytes from
828    the beginning of the retrieved data record are returned as if they
829    comprised the entire record.  If any or all of the specified bytes do
830    not exist in the record, the get is successful, and any existing bytes
831    are returned.
832    <p>
833    For example, if the data portion of a retrieved record was 100 bytes,
834    and a partial retrieval was done using a DatabaseEntry having a partial
835    length of 20 and a partial offset of 85, the retrieval would succeed and
836    the retrieved data would be the last 15 bytes of the record.
837    <p>
838    If the calling application is storing an item, length bytes specified
839    by <tt>dlen</tt>, starting at the offset set by <tt>doff</tt>
840    bytes from the beginning of the specified key's data item are replaced
841    by the data specified by the DatabaseEntry.  If the partial length is
842    smaller than the data, the record will grow; if the partial length is
843    larger than the data, the record will shrink.  If the specified bytes do
844    not exist, the record will be extended using nul bytes as necessary, and
845    the store will succeed.
846    <p>
847    It is an error to specify a partial key when performing a put
848    operation of any kind.
849    <p>
850    It is an error to attempt a partial store using the <A HREF="../../../com/sleepycat/db/Database.html#put(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)"><CODE>Database.put</CODE></A> method in a database that supports duplicate records. Partial
851    stores in databases supporting duplicate records must be done using a
852    cursor method.
853    <p>
854    Note that the Partial properties are set only by the caller.  They
855    will never be set by a Database or Cursor method.
856    <p>
857<P>
858<DD><DL>
859<DT><B>Parameters:</B><DD><CODE>doff</CODE> - The offset of the partial record being read or written by the
860    application, in bytes.
861    <p><DD><CODE>dlen</CODE> - The byte length of the partial record being read or written by the
862    application, in bytes.
863    <p><DD><CODE>partial</CODE> - Whether this DatabaseEntry is configured to read or write partial
864    records.</DL>
865</DD>
866</DL>
867<HR>
868
869<A NAME="getRecordNumber()"><!-- --></A><H3>
870getRecordNumber</H3>
871<PRE>
872public int <B>getRecordNumber</B>()</PRE>
873<DL>
874<DD>Return the record number encoded in this entry's buffer.
875<p>
876This method may be called at any time during the life of the application.
877<p>
878<P>
879<DD><DL>
880
881<DT><B>Returns:</B><DD>The record number encoded in this entry's buffer.</DL>
882</DD>
883</DL>
884<HR>
885
886<A NAME="setRecordNumber(int)"><!-- --></A><H3>
887setRecordNumber</H3>
888<PRE>
889public void <B>setRecordNumber</B>(int&nbsp;recno)</PRE>
890<DL>
891<DD>Initialize the entry from a logical record number.  Record numbers
892    are integer keys starting at 1.  When this method is called the data,
893    size and offset fields are implicitly set to hold a byte array
894    representation of the integer key.
895<P>
896<DD><DL>
897<DT><B>Parameters:</B><DD><CODE>recno</CODE> - the record number to be encoded</DL>
898</DD>
899</DL>
900<HR>
901
902<A NAME="getReuseBuffer()"><!-- --></A><H3>
903getReuseBuffer</H3>
904<PRE>
905public boolean <B>getReuseBuffer</B>()</PRE>
906<DL>
907<DD>Return true if the whether the entry is configured to reuse the buffer.
908<p>
909This method may be called at any time during the life of the application.
910<p>
911<P>
912<DD><DL>
913
914<DT><B>Returns:</B><DD>True if the whether the entry is configured to reuse the buffer.</DL>
915</DD>
916</DL>
917<HR>
918
919<A NAME="setReuseBuffer(boolean)"><!-- --></A><H3>
920setReuseBuffer</H3>
921<PRE>
922public void <B>setReuseBuffer</B>(boolean&nbsp;reuse)</PRE>
923<DL>
924<DD>Configures the entry to try to reuse the buffer before allocating a new
925    one.
926    <p>
927<P>
928<DD><DL>
929<DT><B>Parameters:</B><DD><CODE>reuse</CODE> - whether to reuse the buffer</DL>
930</DD>
931</DL>
932<HR>
933
934<A NAME="getSize()"><!-- --></A><H3>
935getSize</H3>
936<PRE>
937public int <B>getSize</B>()</PRE>
938<DL>
939<DD>Return the byte size of the data array.
940    <p>
941    For a DatabaseEntry that is used as an output parameter, the size
942    will always be the length of the data array.
943    <p>
944<P>
945<DD><DL>
946
947<DT><B>Returns:</B><DD>Number of bytes in the byte array to be included.</DL>
948</DD>
949</DL>
950<HR>
951
952<A NAME="setSize(int)"><!-- --></A><H3>
953setSize</H3>
954<PRE>
955public void <B>setSize</B>(int&nbsp;size)</PRE>
956<DL>
957<DD>Set the byte size of the data array.
958    <p>
959<P>
960<DD><DL>
961<DT><B>Parameters:</B><DD><CODE>size</CODE> - Number of bytes in the byte array to be included.</DL>
962</DD>
963</DL>
964<HR>
965
966<A NAME="getUserBuffer()"><!-- --></A><H3>
967getUserBuffer</H3>
968<PRE>
969public boolean <B>getUserBuffer</B>()</PRE>
970<DL>
971<DD>Return true if the whether the buffer in this entry is owned by the
972    application.
973<p>
974This method may be called at any time during the life of the application.
975<p>
976<P>
977<DD><DL>
978
979<DT><B>Returns:</B><DD>True if the whether the buffer in this entry is owned by the
980    application.</DL>
981</DD>
982</DL>
983<HR>
984
985<A NAME="getUserBufferLength()"><!-- --></A><H3>
986getUserBufferLength</H3>
987<PRE>
988public int <B>getUserBufferLength</B>()</PRE>
989<DL>
990<DD>Return the length of the application's buffer.
991<p>
992This method may be called at any time during the life of the application.
993<p>
994<P>
995<DD><DL>
996
997<DT><B>Returns:</B><DD>The length of the application's buffer.</DL>
998</DD>
999</DL>
1000<HR>
1001
1002<A NAME="setUserBuffer(int, boolean)"><!-- --></A><H3>
1003setUserBuffer</H3>
1004<PRE>
1005public void <B>setUserBuffer</B>(int&nbsp;length,
1006                          boolean&nbsp;usermem)</PRE>
1007<DL>
1008<DD>Configures the entry with an application-owned buffer.
1009    <p>
1010    The <code>data</code> field of the entry must refer to a buffer that is
1011    at least <code>length</code> bytes in length.
1012    <p>
1013    If the length of the requested item is less than or equal to that number
1014    of bytes, the item is copied into the memory to which the
1015    <code>data</code> field refers.  Otherwise, the <code>size</code> field
1016    is set to the length needed for the requested item, and a
1017    <A HREF="../../../com/sleepycat/db/MemoryException.html" title="class in com.sleepycat.db"><CODE>MemoryException</CODE></A> is thrown.
1018    <p>
1019    Applications can determine the length of a record by setting
1020    <code>length</code> to 0 and calling <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getSize()"><CODE>DatabaseEntry.getSize</CODE></A>
1021    on the return value.
1022    <p>
1023<P>
1024<DD><DL>
1025<DT><B>Parameters:</B><DD><CODE>length</CODE> - the length of the buffer
1026    <p><DD><CODE>usermem</CODE> - whether the buffer is owned by the application</DL>
1027</DD>
1028</DL>
1029<HR>
1030
1031<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
1032equals</H3>
1033<PRE>
1034public boolean <B>equals</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;o)</PRE>
1035<DL>
1036<DD>Compares the data of two entries for byte-by-byte equality.
1037
1038 <p>In either entry, if the offset is non-zero or the size is not equal
1039 to the data array length, then only the data bounded by these values is
1040 compared.  The data array length and offset need not be the same in both
1041 entries for them to be considered equal.</p>
1042
1043 <p>If the data array is null in one entry, then to be considered equal
1044 both entries must have a null data array.</p>
1045
1046 <p>If the partial property is set in either entry, then to be considered
1047 equal both entries must have the same partial properties: partial,
1048 partialOffset and partialLength.
1049<P>
1050<DD><DL>
1051<DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
1052</DD>
1053<DD><DL>
1054</DL>
1055</DD>
1056</DL>
1057<HR>
1058
1059<A NAME="hashCode()"><!-- --></A><H3>
1060hashCode</H3>
1061<PRE>
1062public int <B>hashCode</B>()</PRE>
1063<DL>
1064<DD>Returns a hash code based on the data value.
1065<P>
1066<DD><DL>
1067<DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
1068</DD>
1069<DD><DL>
1070</DL>
1071</DD>
1072</DL>
1073<!-- ========= END OF CLASS DATA ========= -->
1074<HR>
1075
1076
1077<!-- ======= START OF BOTTOM NAVBAR ====== -->
1078<A NAME="navbar_bottom"><!-- --></A>
1079<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
1080<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
1081<TR>
1082<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
1083<A NAME="navbar_bottom_firstrow"><!-- --></A>
1084<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
1085  <TR ALIGN="center" VALIGN="top">
1086  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
1087  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
1088  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
1089  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DatabaseEntry.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
1090  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
1091  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
1092  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
1093  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
1094  </TR>
1095</TABLE>
1096</TD>
1097<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
1098<b>Berkeley DB</b><br><font size="-1"> version 4.8.30</font></EM>
1099</TD>
1100</TR>
1101
1102<TR>
1103<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1104&nbsp;<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A>&nbsp;
1105&nbsp;<A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD>
1106<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1107  <A HREF="../../../index.html?com/sleepycat/db/DatabaseEntry.html" target="_top"><B>FRAMES</B></A>  &nbsp;
1108&nbsp;<A HREF="DatabaseEntry.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
1109&nbsp;<SCRIPT type="text/javascript">
1110  <!--
1111  if(window==top) {
1112    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
1113  }
1114  //-->
1115</SCRIPT>
1116<NOSCRIPT>
1117  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
1118</NOSCRIPT>
1119
1120
1121</FONT></TD>
1122</TR>
1123<TR>
1124<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1125  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
1126<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1127DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
1128</TR>
1129</TABLE>
1130<A NAME="skip-navbar_bottom"></A>
1131<!-- ======== END OF BOTTOM NAVBAR ======= -->
1132
1133<HR>
1134<font size=1>Copyright (c) 1996-2009 Oracle.  All rights reserved.</font>
1135</BODY>
1136</HTML>
1137