source: proiecte/HadoopJUnit/hadoop-0.20.1/docs/api/org/apache/hadoop/io/BytesWritable.html @ 120

Last change on this file since 120 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 29.8 KB
Line 
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_07) on Tue Sep 01 20:56:52 UTC 2009 -->
6<TITLE>
7BytesWritable (Hadoop 0.20.1 API)
8</TITLE>
9
10<META NAME="date" CONTENT="2009-09-01">
11
12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.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="BytesWritable (Hadoop 0.20.1 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/BytesWritable.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</EM>
53</TD>
54</TR>
55
56<TR>
57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58&nbsp;<A HREF="../../../../org/apache/hadoop/io/BooleanWritable.Comparator.html" title="class in org.apache.hadoop.io"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../org/apache/hadoop/io/BytesWritable.Comparator.html" title="class in org.apache.hadoop.io"><B>NEXT CLASS</B></A></FONT></TD>
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61  <A HREF="../../../../index.html?org/apache/hadoop/io/BytesWritable.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="BytesWritable.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;<A HREF="#nested_class_summary">NESTED</A>&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">
91org.apache.hadoop.io</FONT>
92<BR>
93Class BytesWritable</H2>
94<PRE>
95<A HREF="http://java.sun.com/javase/6/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 "><A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">org.apache.hadoop.io.BinaryComparable</A>
97      <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.hadoop.io.BytesWritable</B>
98</PRE>
99<DL>
100<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A>&lt;<A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</A>&gt;, <A HREF="../../../../org/apache/hadoop/io/Writable.html" title="interface in org.apache.hadoop.io">Writable</A>, <A HREF="../../../../org/apache/hadoop/io/WritableComparable.html" title="interface in org.apache.hadoop.io">WritableComparable</A>&lt;<A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</A>&gt;</DD>
101</DL>
102<HR>
103<DL>
104<DT><PRE>public class <B>BytesWritable</B><DT>extends <A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</A><DT>implements <A HREF="../../../../org/apache/hadoop/io/WritableComparable.html" title="interface in org.apache.hadoop.io">WritableComparable</A>&lt;<A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</A>&gt;</DL>
105</PRE>
106
107<P>
108A byte sequence that is usable as a key or value.
109 It is resizable and distinguishes between the size of the seqeunce and
110 the current capacity. The hash function is the front of the md5 of the
111 buffer. The sort order is the same as memcmp.
112<P>
113
114<P>
115<HR>
116
117<P>
118<!-- ======== NESTED CLASS SUMMARY ======== -->
119
120<A NAME="nested_class_summary"><!-- --></A>
121<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
122<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
123<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
124<B>Nested Class Summary</B></FONT></TH>
125</TR>
126<TR BGCOLOR="white" CLASS="TableRowColor">
127<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
128<CODE>static&nbsp;class</CODE></FONT></TD>
129<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.Comparator.html" title="class in org.apache.hadoop.io">BytesWritable.Comparator</A></B></CODE>
130
131<BR>
132&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A Comparator optimized for BytesWritable.</TD>
133</TR>
134</TABLE>
135&nbsp;
136<!-- ======== CONSTRUCTOR SUMMARY ======== -->
137
138<A NAME="constructor_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>Constructor Summary</B></FONT></TH>
143</TR>
144<TR BGCOLOR="white" CLASS="TableRowColor">
145<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#BytesWritable()">BytesWritable</A></B>()</CODE>
146
147<BR>
148&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a zero-size sequence.</TD>
149</TR>
150<TR BGCOLOR="white" CLASS="TableRowColor">
151<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#BytesWritable(byte[])">BytesWritable</A></B>(byte[]&nbsp;bytes)</CODE>
152
153<BR>
154&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a BytesWritable using the byte array as the initial value.</TD>
155</TR>
156</TABLE>
157&nbsp;
158<!-- ========== METHOD SUMMARY =========== -->
159
160<A NAME="method_summary"><!-- --></A>
161<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
162<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
163<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
164<B>Method Summary</B></FONT></TH>
165</TR>
166<TR BGCOLOR="white" CLASS="TableRowColor">
167<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
168<CODE>&nbsp;boolean</CODE></FONT></TD>
169<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#equals(java.lang.Object)">equals</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;right_obj)</CODE>
170
171<BR>
172&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Are the two byte sequences equal?</TD>
173</TR>
174<TR BGCOLOR="white" CLASS="TableRowColor">
175<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
176<CODE>&nbsp;byte[]</CODE></FONT></TD>
177<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#get()">get</A></B>()</CODE>
178
179<BR>
180&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>Use <A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#getBytes()"><CODE>getBytes()</CODE></A> instead.</I></TD>
181</TR>
182<TR BGCOLOR="white" CLASS="TableRowColor">
183<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
184<CODE>&nbsp;byte[]</CODE></FONT></TD>
185<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#getBytes()">getBytes</A></B>()</CODE>
186
187<BR>
188&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the data from the BytesWritable.</TD>
189</TR>
190<TR BGCOLOR="white" CLASS="TableRowColor">
191<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
192<CODE>&nbsp;int</CODE></FONT></TD>
193<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#getCapacity()">getCapacity</A></B>()</CODE>
194
195<BR>
196&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the capacity, which is the maximum size that could handled without
197 resizing the backing storage.</TD>
198</TR>
199<TR BGCOLOR="white" CLASS="TableRowColor">
200<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
201<CODE>&nbsp;int</CODE></FONT></TD>
202<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#getLength()">getLength</A></B>()</CODE>
203
204<BR>
205&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the current size of the buffer.</TD>
206</TR>
207<TR BGCOLOR="white" CLASS="TableRowColor">
208<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
209<CODE>&nbsp;int</CODE></FONT></TD>
210<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#getSize()">getSize</A></B>()</CODE>
211
212<BR>
213&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>Use <A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#getLength()"><CODE>getLength()</CODE></A> instead.</I></TD>
214</TR>
215<TR BGCOLOR="white" CLASS="TableRowColor">
216<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
217<CODE>&nbsp;int</CODE></FONT></TD>
218<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#hashCode()">hashCode</A></B>()</CODE>
219
220<BR>
221&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return a hash of the bytes returned from {#getBytes()}.</TD>
222</TR>
223<TR BGCOLOR="white" CLASS="TableRowColor">
224<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
225<CODE>&nbsp;void</CODE></FONT></TD>
226<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#readFields(java.io.DataInput)">readFields</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataInput.html?is-external=true" title="class or interface in java.io">DataInput</A>&nbsp;in)</CODE>
227
228<BR>
229&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deserialize the fields of this object from <code>in</code>.</TD>
230</TR>
231<TR BGCOLOR="white" CLASS="TableRowColor">
232<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
233<CODE>&nbsp;void</CODE></FONT></TD>
234<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#set(byte[], int, int)">set</A></B>(byte[]&nbsp;newData,
235    int&nbsp;offset,
236    int&nbsp;length)</CODE>
237
238<BR>
239&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the value to a copy of the given byte range</TD>
240</TR>
241<TR BGCOLOR="white" CLASS="TableRowColor">
242<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
243<CODE>&nbsp;void</CODE></FONT></TD>
244<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#set(org.apache.hadoop.io.BytesWritable)">set</A></B>(<A HREF="../../../../org/apache/hadoop/io/BytesWritable.html" title="class in org.apache.hadoop.io">BytesWritable</A>&nbsp;newData)</CODE>
245
246<BR>
247&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the BytesWritable to the contents of the given newData.</TD>
248</TR>
249<TR BGCOLOR="white" CLASS="TableRowColor">
250<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
251<CODE>&nbsp;void</CODE></FONT></TD>
252<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#setCapacity(int)">setCapacity</A></B>(int&nbsp;new_cap)</CODE>
253
254<BR>
255&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Change the capacity of the backing storage.</TD>
256</TR>
257<TR BGCOLOR="white" CLASS="TableRowColor">
258<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
259<CODE>&nbsp;void</CODE></FONT></TD>
260<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#setSize(int)">setSize</A></B>(int&nbsp;size)</CODE>
261
262<BR>
263&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Change the size of the buffer.</TD>
264</TR>
265<TR BGCOLOR="white" CLASS="TableRowColor">
266<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
267<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
268<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#toString()">toString</A></B>()</CODE>
269
270<BR>
271&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generate the stream of bytes as hex pairs separated by ' '.</TD>
272</TR>
273<TR BGCOLOR="white" CLASS="TableRowColor">
274<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
275<CODE>&nbsp;void</CODE></FONT></TD>
276<TD><CODE><B><A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#write(java.io.DataOutput)">write</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataOutput.html?is-external=true" title="class or interface in java.io">DataOutput</A>&nbsp;out)</CODE>
277
278<BR>
279&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Serialize the fields of this object to <code>out</code>.</TD>
280</TR>
281</TABLE>
282&nbsp;<A NAME="methods_inherited_from_class_org.apache.hadoop.io.BinaryComparable"><!-- --></A>
283<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
284<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
285<TH ALIGN="left"><B>Methods inherited from class org.apache.hadoop.io.<A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</A></B></TH>
286</TR>
287<TR BGCOLOR="white" CLASS="TableRowColor">
288<TD><CODE><A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html#compareTo(org.apache.hadoop.io.BinaryComparable)">compareTo</A>, <A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html#compareTo(byte[], int, int)">compareTo</A></CODE></TD>
289</TR>
290</TABLE>
291&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
292<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
293<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
294<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
295</TR>
296<TR BGCOLOR="white" CLASS="TableRowColor">
297<TD><CODE><A HREF="http://java.sun.com/javase/6/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/javase/6/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/javase/6/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/javase/6/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/javase/6/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/javase/6/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/javase/6/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/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
298</TR>
299</TABLE>
300&nbsp;<A NAME="methods_inherited_from_class_java.lang.Comparable"><!-- --></A>
301<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
302<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
303<TH ALIGN="left"><B>Methods inherited from interface java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</A></B></TH>
304</TR>
305<TR BGCOLOR="white" CLASS="TableRowColor">
306<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true#compareTo(T)" title="class or interface in java.lang">compareTo</A></CODE></TD>
307</TR>
308</TABLE>
309&nbsp;
310<P>
311
312<!-- ========= CONSTRUCTOR DETAIL ======== -->
313
314<A NAME="constructor_detail"><!-- --></A>
315<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
316<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
317<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
318<B>Constructor Detail</B></FONT></TH>
319</TR>
320</TABLE>
321
322<A NAME="BytesWritable()"><!-- --></A><H3>
323BytesWritable</H3>
324<PRE>
325public <B>BytesWritable</B>()</PRE>
326<DL>
327<DD>Create a zero-size sequence.
328<P>
329</DL>
330<HR>
331
332<A NAME="BytesWritable(byte[])"><!-- --></A><H3>
333BytesWritable</H3>
334<PRE>
335public <B>BytesWritable</B>(byte[]&nbsp;bytes)</PRE>
336<DL>
337<DD>Create a BytesWritable using the byte array as the initial value.
338<P>
339<DL>
340<DT><B>Parameters:</B><DD><CODE>bytes</CODE> - This array becomes the backing storage for the object.</DL>
341</DL>
342
343<!-- ============ METHOD DETAIL ========== -->
344
345<A NAME="method_detail"><!-- --></A>
346<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
347<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
348<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
349<B>Method Detail</B></FONT></TH>
350</TR>
351</TABLE>
352
353<A NAME="getBytes()"><!-- --></A><H3>
354getBytes</H3>
355<PRE>
356public byte[] <B>getBytes</B>()</PRE>
357<DL>
358<DD>Get the data from the BytesWritable.
359<P>
360<DD><DL>
361<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html#getBytes()">getBytes</A></CODE> in class <CODE><A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</A></CODE></DL>
362</DD>
363<DD><DL>
364
365<DT><B>Returns:</B><DD>The data is only valid between 0 and getLength() - 1.</DL>
366</DD>
367</DL>
368<HR>
369
370<A NAME="get()"><!-- --></A><H3>
371get</H3>
372<PRE>
373<FONT SIZE="-1"><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
374</FONT>public byte[] <B>get</B>()</PRE>
375<DL>
376<DD><B>Deprecated.</B>&nbsp;<I>Use <A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#getBytes()"><CODE>getBytes()</CODE></A> instead.</I>
377<P>
378<DD>Get the data from the BytesWritable.
379<P>
380<DD><DL>
381</DL>
382</DD>
383<DD><DL>
384</DL>
385</DD>
386</DL>
387<HR>
388
389<A NAME="getLength()"><!-- --></A><H3>
390getLength</H3>
391<PRE>
392public int <B>getLength</B>()</PRE>
393<DL>
394<DD>Get the current size of the buffer.
395<P>
396<DD><DL>
397<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html#getLength()">getLength</A></CODE> in class <CODE><A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</A></CODE></DL>
398</DD>
399<DD><DL>
400</DL>
401</DD>
402</DL>
403<HR>
404
405<A NAME="getSize()"><!-- --></A><H3>
406getSize</H3>
407<PRE>
408<FONT SIZE="-1"><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</A>
409</FONT>public int <B>getSize</B>()</PRE>
410<DL>
411<DD><B>Deprecated.</B>&nbsp;<I>Use <A HREF="../../../../org/apache/hadoop/io/BytesWritable.html#getLength()"><CODE>getLength()</CODE></A> instead.</I>
412<P>
413<DD>Get the current size of the buffer.
414<P>
415<DD><DL>
416</DL>
417</DD>
418<DD><DL>
419</DL>
420</DD>
421</DL>
422<HR>
423
424<A NAME="setSize(int)"><!-- --></A><H3>
425setSize</H3>
426<PRE>
427public void <B>setSize</B>(int&nbsp;size)</PRE>
428<DL>
429<DD>Change the size of the buffer. The values in the old range are preserved
430 and any new values are undefined. The capacity is changed if it is
431 necessary.
432<P>
433<DD><DL>
434</DL>
435</DD>
436<DD><DL>
437<DT><B>Parameters:</B><DD><CODE>size</CODE> - The new number of bytes</DL>
438</DD>
439</DL>
440<HR>
441
442<A NAME="getCapacity()"><!-- --></A><H3>
443getCapacity</H3>
444<PRE>
445public int <B>getCapacity</B>()</PRE>
446<DL>
447<DD>Get the capacity, which is the maximum size that could handled without
448 resizing the backing storage.
449<P>
450<DD><DL>
451</DL>
452</DD>
453<DD><DL>
454
455<DT><B>Returns:</B><DD>The number of bytes</DL>
456</DD>
457</DL>
458<HR>
459
460<A NAME="setCapacity(int)"><!-- --></A><H3>
461setCapacity</H3>
462<PRE>
463public void <B>setCapacity</B>(int&nbsp;new_cap)</PRE>
464<DL>
465<DD>Change the capacity of the backing storage.
466 The data is preserved.
467<P>
468<DD><DL>
469</DL>
470</DD>
471<DD><DL>
472<DT><B>Parameters:</B><DD><CODE>new_cap</CODE> - The new capacity in bytes.</DL>
473</DD>
474</DL>
475<HR>
476
477<A NAME="set(org.apache.hadoop.io.BytesWritable)"><!-- --></A><H3>
478set</H3>
479<PRE>
480public void <B>set</B>(<A HREF="../../../../org/apache/hadoop/io/BytesWritable.html" title="class in org.apache.hadoop.io">BytesWritable</A>&nbsp;newData)</PRE>
481<DL>
482<DD>Set the BytesWritable to the contents of the given newData.
483<P>
484<DD><DL>
485</DL>
486</DD>
487<DD><DL>
488<DT><B>Parameters:</B><DD><CODE>newData</CODE> - the value to set this BytesWritable to.</DL>
489</DD>
490</DL>
491<HR>
492
493<A NAME="set(byte[], int, int)"><!-- --></A><H3>
494set</H3>
495<PRE>
496public void <B>set</B>(byte[]&nbsp;newData,
497                int&nbsp;offset,
498                int&nbsp;length)</PRE>
499<DL>
500<DD>Set the value to a copy of the given byte range
501<P>
502<DD><DL>
503</DL>
504</DD>
505<DD><DL>
506<DT><B>Parameters:</B><DD><CODE>newData</CODE> - the new values to copy in<DD><CODE>offset</CODE> - the offset in newData to start at<DD><CODE>length</CODE> - the number of bytes to copy</DL>
507</DD>
508</DL>
509<HR>
510
511<A NAME="readFields(java.io.DataInput)"><!-- --></A><H3>
512readFields</H3>
513<PRE>
514public void <B>readFields</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataInput.html?is-external=true" title="class or interface in java.io">DataInput</A>&nbsp;in)
515                throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
516<DL>
517<DD><B>Description copied from interface: <CODE><A HREF="../../../../org/apache/hadoop/io/Writable.html#readFields(java.io.DataInput)">Writable</A></CODE></B></DD>
518<DD>Deserialize the fields of this object from <code>in</code>
519 
520 <p>For efficiency, implementations should attempt to re-use storage in the
521 existing object where possible.</p>
522<P>
523<DD><DL>
524<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/hadoop/io/Writable.html#readFields(java.io.DataInput)">readFields</A></CODE> in interface <CODE><A HREF="../../../../org/apache/hadoop/io/Writable.html" title="interface in org.apache.hadoop.io">Writable</A></CODE></DL>
525</DD>
526<DD><DL>
527<DT><B>Parameters:</B><DD><CODE>in</CODE> - <code>DataInput</code> to deseriablize this object from.
528<DT><B>Throws:</B>
529<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
530</DD>
531</DL>
532<HR>
533
534<A NAME="write(java.io.DataOutput)"><!-- --></A><H3>
535write</H3>
536<PRE>
537public void <B>write</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/DataOutput.html?is-external=true" title="class or interface in java.io">DataOutput</A>&nbsp;out)
538           throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></PRE>
539<DL>
540<DD><B>Description copied from interface: <CODE><A HREF="../../../../org/apache/hadoop/io/Writable.html#write(java.io.DataOutput)">Writable</A></CODE></B></DD>
541<DD>Serialize the fields of this object to <code>out</code>.
542<P>
543<DD><DL>
544<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/apache/hadoop/io/Writable.html#write(java.io.DataOutput)">write</A></CODE> in interface <CODE><A HREF="../../../../org/apache/hadoop/io/Writable.html" title="interface in org.apache.hadoop.io">Writable</A></CODE></DL>
545</DD>
546<DD><DL>
547<DT><B>Parameters:</B><DD><CODE>out</CODE> - <code>DataOuput</code> to serialize this object into.
548<DT><B>Throws:</B>
549<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE></DL>
550</DD>
551</DL>
552<HR>
553
554<A NAME="hashCode()"><!-- --></A><H3>
555hashCode</H3>
556<PRE>
557public int <B>hashCode</B>()</PRE>
558<DL>
559<DD><B>Description copied from class: <CODE><A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html#hashCode()">BinaryComparable</A></CODE></B></DD>
560<DD>Return a hash of the bytes returned from {#getBytes()}.
561<P>
562<DD><DL>
563<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</A></CODE></DL>
564</DD>
565<DD><DL>
566<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/hadoop/io/WritableComparator.html#hashBytes(byte[], int)"><CODE>WritableComparator.hashBytes(byte[],int)</CODE></A></DL>
567</DD>
568</DL>
569<HR>
570
571<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
572equals</H3>
573<PRE>
574public boolean <B>equals</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;right_obj)</PRE>
575<DL>
576<DD>Are the two byte sequences equal?
577<P>
578<DD><DL>
579<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</A></CODE></DL>
580</DD>
581<DD><DL>
582</DL>
583</DD>
584</DL>
585<HR>
586
587<A NAME="toString()"><!-- --></A><H3>
588toString</H3>
589<PRE>
590public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>toString</B>()</PRE>
591<DL>
592<DD>Generate the stream of bytes as hex pairs separated by ' '.
593<P>
594<DD><DL>
595<DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A></CODE> in class <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
596</DD>
597<DD><DL>
598</DL>
599</DD>
600</DL>
601<!-- ========= END OF CLASS DATA ========= -->
602<HR>
603
604
605<!-- ======= START OF BOTTOM NAVBAR ====== -->
606<A NAME="navbar_bottom"><!-- --></A>
607<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
608<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
609<TR>
610<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
611<A NAME="navbar_bottom_firstrow"><!-- --></A>
612<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
613  <TR ALIGN="center" VALIGN="top">
614  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
615  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
616  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
617  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/BytesWritable.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
618  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
619  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
620  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
621  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
622  </TR>
623</TABLE>
624</TD>
625<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
626</EM>
627</TD>
628</TR>
629
630<TR>
631<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
632&nbsp;<A HREF="../../../../org/apache/hadoop/io/BooleanWritable.Comparator.html" title="class in org.apache.hadoop.io"><B>PREV CLASS</B></A>&nbsp;
633&nbsp;<A HREF="../../../../org/apache/hadoop/io/BytesWritable.Comparator.html" title="class in org.apache.hadoop.io"><B>NEXT CLASS</B></A></FONT></TD>
634<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
635  <A HREF="../../../../index.html?org/apache/hadoop/io/BytesWritable.html" target="_top"><B>FRAMES</B></A>  &nbsp;
636&nbsp;<A HREF="BytesWritable.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
637&nbsp;<SCRIPT type="text/javascript">
638  <!--
639  if(window==top) {
640    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
641  }
642  //-->
643</SCRIPT>
644<NOSCRIPT>
645  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
646</NOSCRIPT>
647
648
649</FONT></TD>
650</TR>
651<TR>
652<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
653  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
654<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
655DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
656</TR>
657</TABLE>
658<A NAME="skip-navbar_bottom"></A>
659<!-- ======== END OF BOTTOM NAVBAR ======= -->
660
661<HR>
662Copyright &copy; 2009 The Apache Software Foundation
663</BODY>
664</HTML>
Note: See TracBrowser for help on using the repository browser.