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:54 UTC 2009 --> |
---|
6 | <TITLE> |
---|
7 | Buffer (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"> |
---|
15 | function windowTitle() |
---|
16 | { |
---|
17 | if (location.href.indexOf('is-external=true') == -1) { |
---|
18 | parent.document.title="Buffer (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> </TD> |
---|
41 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
42 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
43 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Buffer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
44 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
45 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
46 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
47 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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 | <A HREF="../../../../org/apache/hadoop/record/BinaryRecordOutput.html" title="class in org.apache.hadoop.record"><B>PREV CLASS</B></A> |
---|
59 | <A HREF="../../../../org/apache/hadoop/record/CsvRecordInput.html" title="class in org.apache.hadoop.record"><B>NEXT CLASS</B></A></FONT></TD> |
---|
60 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
61 | <A HREF="../../../../index.html?org/apache/hadoop/record/Buffer.html" target="_top"><B>FRAMES</B></A> |
---|
62 | <A HREF="Buffer.html" target="_top"><B>NO FRAMES</B></A> |
---|
63 | <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
80 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
81 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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"> |
---|
91 | org.apache.hadoop.record</FONT> |
---|
92 | <BR> |
---|
93 | Class Buffer</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 "><B>org.apache.hadoop.record.Buffer</B> |
---|
97 | </PRE> |
---|
98 | <DL> |
---|
99 | <DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang">Cloneable</A>, <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></DD> |
---|
100 | </DL> |
---|
101 | <HR> |
---|
102 | <DL> |
---|
103 | <DT><PRE>public class <B>Buffer</B><DT>extends <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><DT>implements <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>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang">Cloneable</A></DL> |
---|
104 | </PRE> |
---|
105 | |
---|
106 | <P> |
---|
107 | A byte sequence that is used as a Java native type for buffer. |
---|
108 | It is resizable and distinguishes between the count of the seqeunce and |
---|
109 | the current capacity. |
---|
110 | <P> |
---|
111 | |
---|
112 | <P> |
---|
113 | <HR> |
---|
114 | |
---|
115 | <P> |
---|
116 | |
---|
117 | <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
---|
118 | |
---|
119 | <A NAME="constructor_summary"><!-- --></A> |
---|
120 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
121 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
122 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
123 | <B>Constructor Summary</B></FONT></TH> |
---|
124 | </TR> |
---|
125 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
126 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#Buffer()">Buffer</A></B>()</CODE> |
---|
127 | |
---|
128 | <BR> |
---|
129 | Create a zero-count sequence.</TD> |
---|
130 | </TR> |
---|
131 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
132 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#Buffer(byte[])">Buffer</A></B>(byte[] bytes)</CODE> |
---|
133 | |
---|
134 | <BR> |
---|
135 | Create a Buffer using the byte array as the initial value.</TD> |
---|
136 | </TR> |
---|
137 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
138 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#Buffer(byte[], int, int)">Buffer</A></B>(byte[] bytes, |
---|
139 | int offset, |
---|
140 | int length)</CODE> |
---|
141 | |
---|
142 | <BR> |
---|
143 | Create a Buffer using the byte range as the initial value.</TD> |
---|
144 | </TR> |
---|
145 | </TABLE> |
---|
146 | |
---|
147 | <!-- ========== METHOD SUMMARY =========== --> |
---|
148 | |
---|
149 | <A NAME="method_summary"><!-- --></A> |
---|
150 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
151 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
152 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
153 | <B>Method Summary</B></FONT></TH> |
---|
154 | </TR> |
---|
155 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
156 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
157 | <CODE> void</CODE></FONT></TD> |
---|
158 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#append(byte[])">append</A></B>(byte[] bytes)</CODE> |
---|
159 | |
---|
160 | <BR> |
---|
161 | Append specified bytes to the buffer</TD> |
---|
162 | </TR> |
---|
163 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
164 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
165 | <CODE> void</CODE></FONT></TD> |
---|
166 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#append(byte[], int, int)">append</A></B>(byte[] bytes, |
---|
167 | int offset, |
---|
168 | int length)</CODE> |
---|
169 | |
---|
170 | <BR> |
---|
171 | Append specified bytes to the buffer.</TD> |
---|
172 | </TR> |
---|
173 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
174 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
175 | <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></FONT></TD> |
---|
176 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#clone()">clone</A></B>()</CODE> |
---|
177 | |
---|
178 | <BR> |
---|
179 | </TD> |
---|
180 | </TR> |
---|
181 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
182 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
183 | <CODE> int</CODE></FONT></TD> |
---|
184 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#compareTo(java.lang.Object)">compareTo</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> other)</CODE> |
---|
185 | |
---|
186 | <BR> |
---|
187 | Define the sort order of the Buffer.</TD> |
---|
188 | </TR> |
---|
189 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
190 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
191 | <CODE> void</CODE></FONT></TD> |
---|
192 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#copy(byte[], int, int)">copy</A></B>(byte[] bytes, |
---|
193 | int offset, |
---|
194 | int length)</CODE> |
---|
195 | |
---|
196 | <BR> |
---|
197 | Copy the specified byte array to the Buffer.</TD> |
---|
198 | </TR> |
---|
199 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
200 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
201 | <CODE> boolean</CODE></FONT></TD> |
---|
202 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.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> other)</CODE> |
---|
203 | |
---|
204 | <BR> |
---|
205 | </TD> |
---|
206 | </TR> |
---|
207 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
208 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
209 | <CODE> byte[]</CODE></FONT></TD> |
---|
210 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#get()">get</A></B>()</CODE> |
---|
211 | |
---|
212 | <BR> |
---|
213 | Get the data from the Buffer.</TD> |
---|
214 | </TR> |
---|
215 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
216 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
217 | <CODE> int</CODE></FONT></TD> |
---|
218 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#getCapacity()">getCapacity</A></B>()</CODE> |
---|
219 | |
---|
220 | <BR> |
---|
221 | Get the capacity, which is the maximum count that could handled without |
---|
222 | resizing the backing storage.</TD> |
---|
223 | </TR> |
---|
224 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
225 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
226 | <CODE> int</CODE></FONT></TD> |
---|
227 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#getCount()">getCount</A></B>()</CODE> |
---|
228 | |
---|
229 | <BR> |
---|
230 | Get the current count of the buffer.</TD> |
---|
231 | </TR> |
---|
232 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
233 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
234 | <CODE> int</CODE></FONT></TD> |
---|
235 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#hashCode()">hashCode</A></B>()</CODE> |
---|
236 | |
---|
237 | <BR> |
---|
238 | </TD> |
---|
239 | </TR> |
---|
240 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
241 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
242 | <CODE> void</CODE></FONT></TD> |
---|
243 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#reset()">reset</A></B>()</CODE> |
---|
244 | |
---|
245 | <BR> |
---|
246 | Reset the buffer to 0 size</TD> |
---|
247 | </TR> |
---|
248 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
249 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
250 | <CODE> void</CODE></FONT></TD> |
---|
251 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#set(byte[])">set</A></B>(byte[] bytes)</CODE> |
---|
252 | |
---|
253 | <BR> |
---|
254 | Use the specified bytes array as underlying sequence.</TD> |
---|
255 | </TR> |
---|
256 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
257 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
258 | <CODE> void</CODE></FONT></TD> |
---|
259 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#setCapacity(int)">setCapacity</A></B>(int newCapacity)</CODE> |
---|
260 | |
---|
261 | <BR> |
---|
262 | Change the capacity of the backing storage.</TD> |
---|
263 | </TR> |
---|
264 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
265 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
266 | <CODE> <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> |
---|
267 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#toString()">toString</A></B>()</CODE> |
---|
268 | |
---|
269 | <BR> |
---|
270 | </TD> |
---|
271 | </TR> |
---|
272 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
273 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
274 | <CODE> <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> |
---|
275 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#toString(java.lang.String)">toString</A></B>(<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> charsetName)</CODE> |
---|
276 | |
---|
277 | <BR> |
---|
278 | Convert the byte buffer to a string an specific character encoding</TD> |
---|
279 | </TR> |
---|
280 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
281 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
282 | <CODE> void</CODE></FONT></TD> |
---|
283 | <TD><CODE><B><A HREF="../../../../org/apache/hadoop/record/Buffer.html#truncate()">truncate</A></B>()</CODE> |
---|
284 | |
---|
285 | <BR> |
---|
286 | Change the capacity of the backing store to be the same as the current |
---|
287 | count of buffer.</TD> |
---|
288 | </TR> |
---|
289 | </TABLE> |
---|
290 | <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
---|
291 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
292 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
293 | <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> |
---|
294 | </TR> |
---|
295 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
296 | <TD><CODE><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> |
---|
297 | </TR> |
---|
298 | </TABLE> |
---|
299 | |
---|
300 | <P> |
---|
301 | |
---|
302 | <!-- ========= CONSTRUCTOR DETAIL ======== --> |
---|
303 | |
---|
304 | <A NAME="constructor_detail"><!-- --></A> |
---|
305 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
306 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
307 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
308 | <B>Constructor Detail</B></FONT></TH> |
---|
309 | </TR> |
---|
310 | </TABLE> |
---|
311 | |
---|
312 | <A NAME="Buffer()"><!-- --></A><H3> |
---|
313 | Buffer</H3> |
---|
314 | <PRE> |
---|
315 | public <B>Buffer</B>()</PRE> |
---|
316 | <DL> |
---|
317 | <DD>Create a zero-count sequence. |
---|
318 | <P> |
---|
319 | </DL> |
---|
320 | <HR> |
---|
321 | |
---|
322 | <A NAME="Buffer(byte[])"><!-- --></A><H3> |
---|
323 | Buffer</H3> |
---|
324 | <PRE> |
---|
325 | public <B>Buffer</B>(byte[] bytes)</PRE> |
---|
326 | <DL> |
---|
327 | <DD>Create a Buffer using the byte array as the initial value. |
---|
328 | <P> |
---|
329 | <DL> |
---|
330 | <DT><B>Parameters:</B><DD><CODE>bytes</CODE> - This array becomes the backing storage for the object.</DL> |
---|
331 | </DL> |
---|
332 | <HR> |
---|
333 | |
---|
334 | <A NAME="Buffer(byte[], int, int)"><!-- --></A><H3> |
---|
335 | Buffer</H3> |
---|
336 | <PRE> |
---|
337 | public <B>Buffer</B>(byte[] bytes, |
---|
338 | int offset, |
---|
339 | int length)</PRE> |
---|
340 | <DL> |
---|
341 | <DD>Create a Buffer using the byte range as the initial value. |
---|
342 | <P> |
---|
343 | <DL> |
---|
344 | <DT><B>Parameters:</B><DD><CODE>bytes</CODE> - Copy of this array becomes the backing storage for the object.<DD><CODE>offset</CODE> - offset into byte array<DD><CODE>length</CODE> - length of data</DL> |
---|
345 | </DL> |
---|
346 | |
---|
347 | <!-- ============ METHOD DETAIL ========== --> |
---|
348 | |
---|
349 | <A NAME="method_detail"><!-- --></A> |
---|
350 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
351 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
352 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
353 | <B>Method Detail</B></FONT></TH> |
---|
354 | </TR> |
---|
355 | </TABLE> |
---|
356 | |
---|
357 | <A NAME="set(byte[])"><!-- --></A><H3> |
---|
358 | set</H3> |
---|
359 | <PRE> |
---|
360 | public void <B>set</B>(byte[] bytes)</PRE> |
---|
361 | <DL> |
---|
362 | <DD>Use the specified bytes array as underlying sequence. |
---|
363 | <P> |
---|
364 | <DD><DL> |
---|
365 | </DL> |
---|
366 | </DD> |
---|
367 | <DD><DL> |
---|
368 | <DT><B>Parameters:</B><DD><CODE>bytes</CODE> - byte sequence</DL> |
---|
369 | </DD> |
---|
370 | </DL> |
---|
371 | <HR> |
---|
372 | |
---|
373 | <A NAME="copy(byte[], int, int)"><!-- --></A><H3> |
---|
374 | copy</H3> |
---|
375 | <PRE> |
---|
376 | public final void <B>copy</B>(byte[] bytes, |
---|
377 | int offset, |
---|
378 | int length)</PRE> |
---|
379 | <DL> |
---|
380 | <DD>Copy the specified byte array to the Buffer. Replaces the current buffer. |
---|
381 | <P> |
---|
382 | <DD><DL> |
---|
383 | </DL> |
---|
384 | </DD> |
---|
385 | <DD><DL> |
---|
386 | <DT><B>Parameters:</B><DD><CODE>bytes</CODE> - byte array to be assigned<DD><CODE>offset</CODE> - offset into byte array<DD><CODE>length</CODE> - length of data</DL> |
---|
387 | </DD> |
---|
388 | </DL> |
---|
389 | <HR> |
---|
390 | |
---|
391 | <A NAME="get()"><!-- --></A><H3> |
---|
392 | get</H3> |
---|
393 | <PRE> |
---|
394 | public byte[] <B>get</B>()</PRE> |
---|
395 | <DL> |
---|
396 | <DD>Get the data from the Buffer. |
---|
397 | <P> |
---|
398 | <DD><DL> |
---|
399 | </DL> |
---|
400 | </DD> |
---|
401 | <DD><DL> |
---|
402 | |
---|
403 | <DT><B>Returns:</B><DD>The data is only valid between 0 and getCount() - 1.</DL> |
---|
404 | </DD> |
---|
405 | </DL> |
---|
406 | <HR> |
---|
407 | |
---|
408 | <A NAME="getCount()"><!-- --></A><H3> |
---|
409 | getCount</H3> |
---|
410 | <PRE> |
---|
411 | public int <B>getCount</B>()</PRE> |
---|
412 | <DL> |
---|
413 | <DD>Get the current count 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="getCapacity()"><!-- --></A><H3> |
---|
425 | getCapacity</H3> |
---|
426 | <PRE> |
---|
427 | public int <B>getCapacity</B>()</PRE> |
---|
428 | <DL> |
---|
429 | <DD>Get the capacity, which is the maximum count that could handled without |
---|
430 | resizing the backing storage. |
---|
431 | <P> |
---|
432 | <DD><DL> |
---|
433 | </DL> |
---|
434 | </DD> |
---|
435 | <DD><DL> |
---|
436 | |
---|
437 | <DT><B>Returns:</B><DD>The number of bytes</DL> |
---|
438 | </DD> |
---|
439 | </DL> |
---|
440 | <HR> |
---|
441 | |
---|
442 | <A NAME="setCapacity(int)"><!-- --></A><H3> |
---|
443 | setCapacity</H3> |
---|
444 | <PRE> |
---|
445 | public void <B>setCapacity</B>(int newCapacity)</PRE> |
---|
446 | <DL> |
---|
447 | <DD>Change the capacity of the backing storage. |
---|
448 | The data is preserved if newCapacity >= getCount(). |
---|
449 | <P> |
---|
450 | <DD><DL> |
---|
451 | </DL> |
---|
452 | </DD> |
---|
453 | <DD><DL> |
---|
454 | <DT><B>Parameters:</B><DD><CODE>newCapacity</CODE> - The new capacity in bytes.</DL> |
---|
455 | </DD> |
---|
456 | </DL> |
---|
457 | <HR> |
---|
458 | |
---|
459 | <A NAME="reset()"><!-- --></A><H3> |
---|
460 | reset</H3> |
---|
461 | <PRE> |
---|
462 | public void <B>reset</B>()</PRE> |
---|
463 | <DL> |
---|
464 | <DD>Reset the buffer to 0 size |
---|
465 | <P> |
---|
466 | <DD><DL> |
---|
467 | </DL> |
---|
468 | </DD> |
---|
469 | <DD><DL> |
---|
470 | </DL> |
---|
471 | </DD> |
---|
472 | </DL> |
---|
473 | <HR> |
---|
474 | |
---|
475 | <A NAME="truncate()"><!-- --></A><H3> |
---|
476 | truncate</H3> |
---|
477 | <PRE> |
---|
478 | public void <B>truncate</B>()</PRE> |
---|
479 | <DL> |
---|
480 | <DD>Change the capacity of the backing store to be the same as the current |
---|
481 | count of buffer. |
---|
482 | <P> |
---|
483 | <DD><DL> |
---|
484 | </DL> |
---|
485 | </DD> |
---|
486 | <DD><DL> |
---|
487 | </DL> |
---|
488 | </DD> |
---|
489 | </DL> |
---|
490 | <HR> |
---|
491 | |
---|
492 | <A NAME="append(byte[], int, int)"><!-- --></A><H3> |
---|
493 | append</H3> |
---|
494 | <PRE> |
---|
495 | public void <B>append</B>(byte[] bytes, |
---|
496 | int offset, |
---|
497 | int length)</PRE> |
---|
498 | <DL> |
---|
499 | <DD>Append specified bytes to the buffer. |
---|
500 | <P> |
---|
501 | <DD><DL> |
---|
502 | </DL> |
---|
503 | </DD> |
---|
504 | <DD><DL> |
---|
505 | <DT><B>Parameters:</B><DD><CODE>bytes</CODE> - byte array to be appended<DD><CODE>offset</CODE> - offset into byte array<DD><CODE>length</CODE> - length of data</DL> |
---|
506 | </DD> |
---|
507 | </DL> |
---|
508 | <HR> |
---|
509 | |
---|
510 | <A NAME="append(byte[])"><!-- --></A><H3> |
---|
511 | append</H3> |
---|
512 | <PRE> |
---|
513 | public void <B>append</B>(byte[] bytes)</PRE> |
---|
514 | <DL> |
---|
515 | <DD>Append specified bytes to the buffer |
---|
516 | <P> |
---|
517 | <DD><DL> |
---|
518 | </DL> |
---|
519 | </DD> |
---|
520 | <DD><DL> |
---|
521 | <DT><B>Parameters:</B><DD><CODE>bytes</CODE> - byte array to be appended</DL> |
---|
522 | </DD> |
---|
523 | </DL> |
---|
524 | <HR> |
---|
525 | |
---|
526 | <A NAME="hashCode()"><!-- --></A><H3> |
---|
527 | hashCode</H3> |
---|
528 | <PRE> |
---|
529 | public int <B>hashCode</B>()</PRE> |
---|
530 | <DL> |
---|
531 | <DD><DL> |
---|
532 | <DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/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/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL> |
---|
533 | </DD> |
---|
534 | <DD><DL> |
---|
535 | </DL> |
---|
536 | </DD> |
---|
537 | </DL> |
---|
538 | <HR> |
---|
539 | |
---|
540 | <A NAME="compareTo(java.lang.Object)"><!-- --></A><H3> |
---|
541 | compareTo</H3> |
---|
542 | <PRE> |
---|
543 | public int <B>compareTo</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> other)</PRE> |
---|
544 | <DL> |
---|
545 | <DD>Define the sort order of the Buffer. |
---|
546 | <P> |
---|
547 | <DD><DL> |
---|
548 | <DT><B>Specified by:</B><DD><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> in interface <CODE><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></CODE></DL> |
---|
549 | </DD> |
---|
550 | <DD><DL> |
---|
551 | <DT><B>Parameters:</B><DD><CODE>other</CODE> - The other buffer |
---|
552 | <DT><B>Returns:</B><DD>Positive if this is bigger than other, 0 if they are equal, and |
---|
553 | negative if this is smaller than other.</DL> |
---|
554 | </DD> |
---|
555 | </DL> |
---|
556 | <HR> |
---|
557 | |
---|
558 | <A NAME="equals(java.lang.Object)"><!-- --></A><H3> |
---|
559 | equals</H3> |
---|
560 | <PRE> |
---|
561 | public 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> other)</PRE> |
---|
562 | <DL> |
---|
563 | <DD><DL> |
---|
564 | <DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/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/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL> |
---|
565 | </DD> |
---|
566 | <DD><DL> |
---|
567 | </DL> |
---|
568 | </DD> |
---|
569 | </DL> |
---|
570 | <HR> |
---|
571 | |
---|
572 | <A NAME="toString()"><!-- --></A><H3> |
---|
573 | toString</H3> |
---|
574 | <PRE> |
---|
575 | public <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> |
---|
576 | <DL> |
---|
577 | <DD><DL> |
---|
578 | <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> |
---|
579 | </DD> |
---|
580 | <DD><DL> |
---|
581 | </DL> |
---|
582 | </DD> |
---|
583 | </DL> |
---|
584 | <HR> |
---|
585 | |
---|
586 | <A NAME="toString(java.lang.String)"><!-- --></A><H3> |
---|
587 | toString</H3> |
---|
588 | <PRE> |
---|
589 | public <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>(<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> charsetName) |
---|
590 | throws <A HREF="http://java.sun.com/javase/6/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</A></PRE> |
---|
591 | <DL> |
---|
592 | <DD>Convert the byte buffer to a string an specific character encoding |
---|
593 | <P> |
---|
594 | <DD><DL> |
---|
595 | </DL> |
---|
596 | </DD> |
---|
597 | <DD><DL> |
---|
598 | <DT><B>Parameters:</B><DD><CODE>charsetName</CODE> - Valid Java Character Set Name |
---|
599 | <DT><B>Throws:</B> |
---|
600 | <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/io/UnsupportedEncodingException.html?is-external=true" title="class or interface in java.io">UnsupportedEncodingException</A></CODE></DL> |
---|
601 | </DD> |
---|
602 | </DL> |
---|
603 | <HR> |
---|
604 | |
---|
605 | <A NAME="clone()"><!-- --></A><H3> |
---|
606 | clone</H3> |
---|
607 | <PRE> |
---|
608 | public <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>clone</B>() |
---|
609 | throws <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/CloneNotSupportedException.html?is-external=true" title="class or interface in java.lang">CloneNotSupportedException</A></PRE> |
---|
610 | <DL> |
---|
611 | <DD><DL> |
---|
612 | <DT><B>Overrides:</B><DD><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></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> |
---|
613 | </DD> |
---|
614 | <DD><DL> |
---|
615 | |
---|
616 | <DT><B>Throws:</B> |
---|
617 | <DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/CloneNotSupportedException.html?is-external=true" title="class or interface in java.lang">CloneNotSupportedException</A></CODE></DL> |
---|
618 | </DD> |
---|
619 | </DL> |
---|
620 | <!-- ========= END OF CLASS DATA ========= --> |
---|
621 | <HR> |
---|
622 | |
---|
623 | |
---|
624 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
---|
625 | <A NAME="navbar_bottom"><!-- --></A> |
---|
626 | <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
---|
627 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
628 | <TR> |
---|
629 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
630 | <A NAME="navbar_bottom_firstrow"><!-- --></A> |
---|
631 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
632 | <TR ALIGN="center" VALIGN="top"> |
---|
633 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
634 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
635 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
636 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Buffer.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
637 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
638 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
639 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
640 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
641 | </TR> |
---|
642 | </TABLE> |
---|
643 | </TD> |
---|
644 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
645 | </EM> |
---|
646 | </TD> |
---|
647 | </TR> |
---|
648 | |
---|
649 | <TR> |
---|
650 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
651 | <A HREF="../../../../org/apache/hadoop/record/BinaryRecordOutput.html" title="class in org.apache.hadoop.record"><B>PREV CLASS</B></A> |
---|
652 | <A HREF="../../../../org/apache/hadoop/record/CsvRecordInput.html" title="class in org.apache.hadoop.record"><B>NEXT CLASS</B></A></FONT></TD> |
---|
653 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
654 | <A HREF="../../../../index.html?org/apache/hadoop/record/Buffer.html" target="_top"><B>FRAMES</B></A> |
---|
655 | <A HREF="Buffer.html" target="_top"><B>NO FRAMES</B></A> |
---|
656 | <SCRIPT type="text/javascript"> |
---|
657 | <!-- |
---|
658 | if(window==top) { |
---|
659 | document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
660 | } |
---|
661 | //--> |
---|
662 | </SCRIPT> |
---|
663 | <NOSCRIPT> |
---|
664 | <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
665 | </NOSCRIPT> |
---|
666 | |
---|
667 | |
---|
668 | </FONT></TD> |
---|
669 | </TR> |
---|
670 | <TR> |
---|
671 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
672 | SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
673 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
674 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
675 | </TR> |
---|
676 | </TABLE> |
---|
677 | <A NAME="skip-navbar_bottom"></A> |
---|
678 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
---|
679 | |
---|
680 | <HR> |
---|
681 | Copyright © 2009 The Apache Software Foundation |
---|
682 | </BODY> |
---|
683 | </HTML> |
---|