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.5.0) on Thu May 15 17:17:32 EDT 2008 -->
6<TITLE>
7SerialBase (Oracle - Berkeley DB Java API)
8</TITLE>
9
10<META NAME="keywords" CONTENT="com.sleepycat.bind.serial.SerialBase class">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="/style.css" TITLE="Style">
13
14<SCRIPT type="text/javascript">
15function windowTitle()
16{
17    parent.document.title="SerialBase (Oracle - Berkeley DB Java API)";
18}
19</SCRIPT>
20<NOSCRIPT>
21</NOSCRIPT>
22
23</HEAD>
24
25<BODY BGCOLOR="white" onload="windowTitle();">
26
27
28<!-- ========= START OF TOP NAVBAR ======= -->
29<A NAME="navbar_top"><!-- --></A>
30<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
31<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
32<TR>
33<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
34<A NAME="navbar_top_firstrow"><!-- --></A>
35<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
36  <TR ALIGN="center" VALIGN="top">
37  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
38  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
39  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
40  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SerialBase.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
43  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
45  </TR>
46</TABLE>
47</TD>
48<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
49<b>Berkeley DB</b><br><font size="-1"> version 4.7.25</font></EM>
50</TD>
51</TR>
52
53<TR>
54<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
55&nbsp;<A HREF="/com/sleepycat/bind/serial/ClassCatalog.html" title="interface in com.sleepycat.bind.serial"><B>PREV CLASS</B></A>&nbsp;
56&nbsp;<A HREF="/com/sleepycat/bind/serial/SerialBinding.html" title="class in com.sleepycat.bind.serial"><B>NEXT CLASS</B></A></FONT></TD>
57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58  <A HREF="/index.html?com/sleepycat/bind/serial/SerialBase.html" target="_top"><B>FRAMES</B></A>  &nbsp;
59&nbsp;<A HREF="SerialBase.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
60&nbsp;<SCRIPT type="text/javascript">
61  <!--
62  if(window==top) {
63    document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>');
64  }
65  //-->
66</SCRIPT>
67<NOSCRIPT>
68  <A HREF="/allclasses-noframe.html"><B>All Classes</B></A>
69</NOSCRIPT>
70
71
72</FONT></TD>
73</TR>
74<TR>
75<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
76  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
77<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
78DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
79</TR>
80</TABLE>
81<A NAME="skip-navbar_top"></A>
82<!-- ========= END OF TOP NAVBAR ========= -->
83
84<HR>
85<!-- ======== START OF CLASS DATA ======== -->
86<H2>
87<FONT SIZE="-1">
88com.sleepycat.bind.serial</FONT>
89<BR>
90Class SerialBase</H2>
91<PRE>
92<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A>
93  <IMG SRC="/resources/inherit.gif" ALT="extended by "><B>com.sleepycat.bind.serial.SerialBase</B>
94</PRE>
95<DL>
96<DT><B>Direct Known Subclasses:</B> <DD><A HREF="/com/sleepycat/bind/serial/SerialBinding.html" title="class in com.sleepycat.bind.serial">SerialBinding</A></DD>
97</DL>
98<HR>
99<DL>
100<DT><PRE>public class <B>SerialBase</B><DT>extends <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></DL>
101</PRE>
102
103<P>
104A base class for serial bindings creators that provides control over the
105 allocation of the output buffer.
106
107 <p>Serial bindings append data to a <A HREF="/com/sleepycat/util/FastOutputStream.html" title="class in com.sleepycat.util"><CODE>FastOutputStream</CODE></A> instance.  This
108 object has a byte array buffer that is resized when it is full.  The
109 reallocation of this buffer can be a performance factor for some
110 applications using large objects.  To manage this issue, the <A HREF="/com/sleepycat/bind/serial/SerialBase.html#setSerialBufferSize(int)"><CODE>setSerialBufferSize(int)</CODE></A> method may be used to control the initial size of the
111 buffer, and the <A HREF="/com/sleepycat/bind/serial/SerialBase.html#getSerialOutput(java.lang.Object)"><CODE>getSerialOutput(java.lang.Object)</CODE></A> method may be overridden by
112 subclasses to take over creation of the FastOutputStream object.</p>
113<P>
114
115<P>
116<HR>
117
118<P>
119
120<!-- ======== CONSTRUCTOR SUMMARY ======== -->
121
122<A NAME="constructor_summary"><!-- --></A>
123<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
124<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
125<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
126<B>Constructor Summary</B></FONT></TH>
127</TR>
128<TR BGCOLOR="white" CLASS="TableRowColor">
129<TD><CODE><B><A HREF="/com/sleepycat/bind/serial/SerialBase.html#SerialBase()">SerialBase</A></B>()</CODE>
130
131<BR>
132&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes the initial output buffer size to zero.</TD>
133</TR>
134</TABLE>
135&nbsp;
136<!-- ========== METHOD SUMMARY =========== -->
137
138<A NAME="method_summary"><!-- --></A>
139<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
140<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
141<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
142<B>Method Summary</B></FONT></TH>
143</TR>
144<TR BGCOLOR="white" CLASS="TableRowColor">
145<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
146<CODE>&nbsp;int</CODE></FONT></TD>
147<TD><CODE><B><A HREF="/com/sleepycat/bind/serial/SerialBase.html#getSerialBufferSize()">getSerialBufferSize</A></B>()</CODE>
148
149<BR>
150&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the initial byte size of the output buffer.</TD>
151</TR>
152<TR BGCOLOR="white" CLASS="TableRowColor">
153<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
154<CODE>protected &nbsp;<A HREF="/com/sleepycat/util/FastOutputStream.html" title="class in com.sleepycat.util">FastOutputStream</A></CODE></FONT></TD>
155<TD><CODE><B><A HREF="/com/sleepycat/bind/serial/SerialBase.html#getSerialOutput(java.lang.Object)">getSerialOutput</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;object)</CODE>
156
157<BR>
158&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an empty SerialOutput instance that will be used by the serial
159 binding or key creator.</TD>
160</TR>
161<TR BGCOLOR="white" CLASS="TableRowColor">
162<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
163<CODE>&nbsp;void</CODE></FONT></TD>
164<TD><CODE><B><A HREF="/com/sleepycat/bind/serial/SerialBase.html#setSerialBufferSize(int)">setSerialBufferSize</A></B>(int&nbsp;byteSize)</CODE>
165
166<BR>
167&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the initial byte size of the output buffer that is allocated by the
168 default implementation of <A HREF="/com/sleepycat/bind/serial/SerialBase.html#getSerialOutput(java.lang.Object)"><CODE>getSerialOutput(java.lang.Object)</CODE></A>.</TD>
169</TR>
170</TABLE>
171&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
172<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
173<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
174<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" title="class or interface in java.lang">Object</A></B></TH>
175</TR>
176<TR BGCOLOR="white" CLASS="TableRowColor">
177<TD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#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#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#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#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#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#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#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#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#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#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#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
178</TR>
179</TABLE>
180&nbsp;
181<P>
182
183<!-- ========= CONSTRUCTOR DETAIL ======== -->
184
185<A NAME="constructor_detail"><!-- --></A>
186<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
187<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
188<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
189<B>Constructor Detail</B></FONT></TH>
190</TR>
191</TABLE>
192
193<A NAME="SerialBase()"><!-- --></A><H3>
194SerialBase</H3>
195<PRE>
196public <B>SerialBase</B>()</PRE>
197<DL>
198<DD>Initializes the initial output buffer size to zero.
199
200 <p>Unless <A HREF="/com/sleepycat/bind/serial/SerialBase.html#setSerialBufferSize(int)"><CODE>setSerialBufferSize(int)</CODE></A> is called, the default <A HREF="/com/sleepycat/util/FastOutputStream.html#DEFAULT_INIT_SIZE"><CODE>FastOutputStream.DEFAULT_INIT_SIZE</CODE></A> size will be used.</p>
201<P>
202</DL>
203
204<!-- ============ METHOD DETAIL ========== -->
205
206<A NAME="method_detail"><!-- --></A>
207<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
208<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
209<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
210<B>Method Detail</B></FONT></TH>
211</TR>
212</TABLE>
213
214<A NAME="setSerialBufferSize(int)"><!-- --></A><H3>
215setSerialBufferSize</H3>
216<PRE>
217public void <B>setSerialBufferSize</B>(int&nbsp;byteSize)</PRE>
218<DL>
219<DD>Sets the initial byte size of the output buffer that is allocated by the
220 default implementation of <A HREF="/com/sleepycat/bind/serial/SerialBase.html#getSerialOutput(java.lang.Object)"><CODE>getSerialOutput(java.lang.Object)</CODE></A>.
221
222 <p>If this property is zero (the default), the default <A HREF="/com/sleepycat/util/FastOutputStream.html#DEFAULT_INIT_SIZE"><CODE>FastOutputStream.DEFAULT_INIT_SIZE</CODE></A> size is used.</p>
223<P>
224<DD><DL>
225<DT><B>Parameters:</B><DD><CODE>byteSize</CODE> - the initial byte size of the output buffer, or zero to
226 use the default size.</DL>
227</DD>
228</DL>
229<HR>
230
231<A NAME="getSerialBufferSize()"><!-- --></A><H3>
232getSerialBufferSize</H3>
233<PRE>
234public int <B>getSerialBufferSize</B>()</PRE>
235<DL>
236<DD>Returns the initial byte size of the output buffer.
237<P>
238<DD><DL>
239
240<DT><B>Returns:</B><DD>the initial byte size of the output buffer.<DT><B>See Also:</B><DD><A HREF="/com/sleepycat/bind/serial/SerialBase.html#setSerialBufferSize(int)"><CODE>setSerialBufferSize(int)</CODE></A></DL>
241</DD>
242</DL>
243<HR>
244
245<A NAME="getSerialOutput(java.lang.Object)"><!-- --></A><H3>
246getSerialOutput</H3>
247<PRE>
248protected <A HREF="/com/sleepycat/util/FastOutputStream.html" title="class in com.sleepycat.util">FastOutputStream</A> <B>getSerialOutput</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;object)</PRE>
249<DL>
250<DD>Returns an empty SerialOutput instance that will be used by the serial
251 binding or key creator.
252
253 <p>The default implementation of this method creates a new SerialOutput
254 with an initial buffer size that can be changed using the <A HREF="/com/sleepycat/bind/serial/SerialBase.html#setSerialBufferSize(int)"><CODE>setSerialBufferSize(int)</CODE></A> method.</p>
255
256 <p>This method may be overridden to return a FastOutputStream instance.
257 For example, an instance per thread could be created and returned by
258 this method.  If a FastOutputStream instance is reused, be sure to call
259 its <A HREF="/com/sleepycat/util/FastOutputStream.html#reset()"><CODE>FastOutputStream.reset()</CODE></A> method before each use.</p>
260<P>
261<DD><DL>
262<DT><B>Parameters:</B><DD><CODE>object</CODE> - is the object to be written to the serial output, and may
263 be used by subclasses to determine the size of the output buffer.
264<DT><B>Returns:</B><DD>an empty FastOutputStream instance.<DT><B>See Also:</B><DD><A HREF="/com/sleepycat/bind/serial/SerialBase.html#setSerialBufferSize(int)"><CODE>setSerialBufferSize(int)</CODE></A></DL>
265</DD>
266</DL>
267<!-- ========= END OF CLASS DATA ========= -->
268<HR>
269
270
271<!-- ======= START OF BOTTOM NAVBAR ====== -->
272<A NAME="navbar_bottom"><!-- --></A>
273<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
274<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
275<TR>
276<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
277<A NAME="navbar_bottom_firstrow"><!-- --></A>
278<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
279  <TR ALIGN="center" VALIGN="top">
280  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
281  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
282  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
283  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SerialBase.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
284  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
285  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
286  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
287  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
288  </TR>
289</TABLE>
290</TD>
291<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
292<b>Berkeley DB</b><br><font size="-1"> version 4.7.25</font></EM>
293</TD>
294</TR>
295
296<TR>
297<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
298&nbsp;<A HREF="/com/sleepycat/bind/serial/ClassCatalog.html" title="interface in com.sleepycat.bind.serial"><B>PREV CLASS</B></A>&nbsp;
299&nbsp;<A HREF="/com/sleepycat/bind/serial/SerialBinding.html" title="class in com.sleepycat.bind.serial"><B>NEXT CLASS</B></A></FONT></TD>
300<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
301  <A HREF="/index.html?com/sleepycat/bind/serial/SerialBase.html" target="_top"><B>FRAMES</B></A>  &nbsp;
302&nbsp;<A HREF="SerialBase.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
303&nbsp;<SCRIPT type="text/javascript">
304  <!--
305  if(window==top) {
306    document.writeln('<A HREF="/allclasses-noframe.html"><B>All Classes</B></A>');
307  }
308  //-->
309</SCRIPT>
310<NOSCRIPT>
311  <A HREF="/allclasses-noframe.html"><B>All Classes</B></A>
312</NOSCRIPT>
313
314
315</FONT></TD>
316</TR>
317<TR>
318<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
319  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
320<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
321DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
322</TR>
323</TABLE>
324<A NAME="skip-navbar_bottom"></A>
325<!-- ======== END OF BOTTOM NAVBAR ======= -->
326
327<HR>
328<font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
329</BODY>
330</HTML>
331