source: sandbox/expresso-solr/solr/docs/api/org/apache/solr/common/util/ByteUtils.html @ 7588

Revision 7588, 16.4 KB checked in by adir, 11 years ago (diff)

Ticket #000 - Adicionando a integracao de buscas com Solr na base a ser isnerida na comunidade

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_24) on Mon Jun 25 15:26:26 EDT 2012 -->
6<META http-equiv="Content-Type" content="text/html; charset=utf-8">
7<TITLE>
8ByteUtils (Solr 4.0.0-ALPHA API)
9</TITLE>
10
11<META NAME="date" CONTENT="2012-06-25">
12
13<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
14
15<SCRIPT type="text/javascript">
16function windowTitle()
17{
18    if (location.href.indexOf('is-external=true') == -1) {
19        parent.document.title="ByteUtils (Solr 4.0.0-ALPHA API)";
20    }
21}
22</SCRIPT>
23<NOSCRIPT>
24</NOSCRIPT>
25
26</HEAD>
27
28<BODY BGCOLOR="white" onload="windowTitle();">
29<HR>
30
31
32<!-- ========= START OF TOP NAVBAR ======= -->
33<A NAME="navbar_top"><!-- --></A>
34<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
35<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
36<TR>
37<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
38<A NAME="navbar_top_firstrow"><!-- --></A>
39<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
40  <TR ALIGN="center" VALIGN="top">
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
43  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ByteUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</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/solr/common/util/Base64.html" title="class in org.apache.solr.common.util"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../../org/apache/solr/common/util/ContentStream.html" title="interface in org.apache.solr.common.util"><B>NEXT CLASS</B></A></FONT></TD>
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61  <A HREF="../../../../../index.html?org/apache/solr/common/util/ByteUtils.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="ByteUtils.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">
91org.apache.solr.common.util</FONT>
92<BR>
93Class ByteUtils</H2>
94<PRE>
95<A HREF="http://download.oracle.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.solr.common.util.ByteUtils</B>
97</PRE>
98<HR>
99<DL>
100<DT><PRE>public class <B>ByteUtils</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
101</PRE>
102
103<P>
104<HR>
105
106<P>
107
108<!-- ======== CONSTRUCTOR SUMMARY ======== -->
109
110<A NAME="constructor_summary"><!-- --></A>
111<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
112<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
113<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
114<B>Constructor Summary</B></FONT></TH>
115</TR>
116<TR BGCOLOR="white" CLASS="TableRowColor">
117<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/util/ByteUtils.html#ByteUtils()">ByteUtils</A></B>()</CODE>
118
119<BR>
120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
121</TR>
122</TABLE>
123&nbsp;
124<!-- ========== METHOD SUMMARY =========== -->
125
126<A NAME="method_summary"><!-- --></A>
127<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
128<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
129<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
130<B>Method Summary</B></FONT></TH>
131</TR>
132<TR BGCOLOR="white" CLASS="TableRowColor">
133<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
134<CODE>static&nbsp;int</CODE></FONT></TD>
135<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/util/ByteUtils.html#UTF16toUTF8(java.lang.CharSequence, int, int, byte[], int)">UTF16toUTF8</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</A>&nbsp;s,
136            int&nbsp;offset,
137            int&nbsp;len,
138            byte[]&nbsp;result,
139            int&nbsp;resultOffset)</CODE>
140
141<BR>
142&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes UTF8 into the byte array, starting at offset.</TD>
143</TR>
144<TR BGCOLOR="white" CLASS="TableRowColor">
145<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
146<CODE>static&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
147<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/util/ByteUtils.html#UTF8toUTF16(byte[], int, int)">UTF8toUTF16</A></B>(byte[]&nbsp;utf8,
148            int&nbsp;offset,
149            int&nbsp;len)</CODE>
150
151<BR>
152&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convert UTF8 bytes into a String</TD>
153</TR>
154<TR BGCOLOR="white" CLASS="TableRowColor">
155<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
156<CODE>static&nbsp;int</CODE></FONT></TD>
157<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/util/ByteUtils.html#UTF8toUTF16(byte[], int, int, char[], int)">UTF8toUTF16</A></B>(byte[]&nbsp;utf8,
158            int&nbsp;offset,
159            int&nbsp;len,
160            char[]&nbsp;out,
161            int&nbsp;out_offset)</CODE>
162
163<BR>
164&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts utf8 to utf16 and returns the number of 16 bit Java chars written.</TD>
165</TR>
166<TR BGCOLOR="white" CLASS="TableRowColor">
167<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
168<CODE>static&nbsp;void</CODE></FONT></TD>
169<TD><CODE><B><A HREF="../../../../../org/apache/solr/common/util/ByteUtils.html#UTF8toUTF16(byte[], int, int, org.apache.noggit.CharArr)">UTF8toUTF16</A></B>(byte[]&nbsp;utf8,
170            int&nbsp;offset,
171            int&nbsp;len,
172            <A HREF="../../../../../org/apache/noggit/CharArr.html" title="class in org.apache.noggit">CharArr</A>&nbsp;out)</CODE>
173
174<BR>
175&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convert UTF8 bytes into UTF16 characters.</TD>
176</TR>
177</TABLE>
178&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
179<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
180<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
181<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
182</TR>
183<TR BGCOLOR="white" CLASS="TableRowColor">
184<TD><CODE><A HREF="http://download.oracle.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://download.oracle.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>, <A HREF="http://download.oracle.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://download.oracle.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://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.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://download.oracle.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://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.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://download.oracle.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://download.oracle.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>
185</TR>
186</TABLE>
187&nbsp;
188<P>
189
190<!-- ========= CONSTRUCTOR DETAIL ======== -->
191
192<A NAME="constructor_detail"><!-- --></A>
193<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
194<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
195<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
196<B>Constructor Detail</B></FONT></TH>
197</TR>
198</TABLE>
199
200<A NAME="ByteUtils()"><!-- --></A><H3>
201ByteUtils</H3>
202<PRE>
203public <B>ByteUtils</B>()</PRE>
204<DL>
205</DL>
206
207<!-- ============ METHOD DETAIL ========== -->
208
209<A NAME="method_detail"><!-- --></A>
210<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
211<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
212<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
213<B>Method Detail</B></FONT></TH>
214</TR>
215</TABLE>
216
217<A NAME="UTF8toUTF16(byte[], int, int, char[], int)"><!-- --></A><H3>
218UTF8toUTF16</H3>
219<PRE>
220public static int <B>UTF8toUTF16</B>(byte[]&nbsp;utf8,
221                              int&nbsp;offset,
222                              int&nbsp;len,
223                              char[]&nbsp;out,
224                              int&nbsp;out_offset)</PRE>
225<DL>
226<DD>Converts utf8 to utf16 and returns the number of 16 bit Java chars written.
227 Full characters are read, even if this reads past the length passed (and can result in
228 an ArrayOutOfBoundsException if invalid UTF8 is passed).  Explicit checks for valid UTF8 are not performed.
229 The char[] out should probably have enough room to hold the worst case of each byte becoming a Java char.
230<P>
231<DD><DL>
232</DL>
233</DD>
234</DL>
235<HR>
236
237<A NAME="UTF8toUTF16(byte[], int, int, org.apache.noggit.CharArr)"><!-- --></A><H3>
238UTF8toUTF16</H3>
239<PRE>
240public static void <B>UTF8toUTF16</B>(byte[]&nbsp;utf8,
241                               int&nbsp;offset,
242                               int&nbsp;len,
243                               <A HREF="../../../../../org/apache/noggit/CharArr.html" title="class in org.apache.noggit">CharArr</A>&nbsp;out)</PRE>
244<DL>
245<DD>Convert UTF8 bytes into UTF16 characters.
246<P>
247<DD><DL>
248</DL>
249</DD>
250</DL>
251<HR>
252
253<A NAME="UTF8toUTF16(byte[], int, int)"><!-- --></A><H3>
254UTF8toUTF16</H3>
255<PRE>
256public static <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>UTF8toUTF16</B>(byte[]&nbsp;utf8,
257                                 int&nbsp;offset,
258                                 int&nbsp;len)</PRE>
259<DL>
260<DD>Convert UTF8 bytes into a String
261<P>
262<DD><DL>
263</DL>
264</DD>
265</DL>
266<HR>
267
268<A NAME="UTF16toUTF8(java.lang.CharSequence, int, int, byte[], int)"><!-- --></A><H3>
269UTF16toUTF8</H3>
270<PRE>
271public static int <B>UTF16toUTF8</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/CharSequence.html?is-external=true" title="class or interface in java.lang">CharSequence</A>&nbsp;s,
272                              int&nbsp;offset,
273                              int&nbsp;len,
274                              byte[]&nbsp;result,
275                              int&nbsp;resultOffset)</PRE>
276<DL>
277<DD>Writes UTF8 into the byte array, starting at offset.  The caller should ensure that
278 there is enough space for the worst-case scenario.
279<P>
280<DD><DL>
281
282<DT><B>Returns:</B><DD>the number of bytes written</DL>
283</DD>
284</DL>
285<!-- ========= END OF CLASS DATA ========= -->
286<HR>
287
288
289<!-- ======= START OF BOTTOM NAVBAR ====== -->
290<A NAME="navbar_bottom"><!-- --></A>
291<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
292<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
293<TR>
294<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
295<A NAME="navbar_bottom_firstrow"><!-- --></A>
296<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
297  <TR ALIGN="center" VALIGN="top">
298  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
299  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
300  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
301  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ByteUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
302  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
303  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
304  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
305  </TR>
306</TABLE>
307</TD>
308<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
309</EM>
310</TD>
311</TR>
312
313<TR>
314<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
315&nbsp;<A HREF="../../../../../org/apache/solr/common/util/Base64.html" title="class in org.apache.solr.common.util"><B>PREV CLASS</B></A>&nbsp;
316&nbsp;<A HREF="../../../../../org/apache/solr/common/util/ContentStream.html" title="interface in org.apache.solr.common.util"><B>NEXT CLASS</B></A></FONT></TD>
317<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
318  <A HREF="../../../../../index.html?org/apache/solr/common/util/ByteUtils.html" target="_top"><B>FRAMES</B></A>  &nbsp;
319&nbsp;<A HREF="ByteUtils.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
320&nbsp;<SCRIPT type="text/javascript">
321  <!--
322  if(window==top) {
323    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
324  }
325  //-->
326</SCRIPT>
327<NOSCRIPT>
328  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
329</NOSCRIPT>
330
331
332</FONT></TD>
333</TR>
334<TR>
335<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
336  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
337<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
338DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
339</TR>
340</TABLE>
341<A NAME="skip-navbar_bottom"></A>
342<!-- ======== END OF BOTTOM NAVBAR ======= -->
343
344<HR>
345
346          <address>Copyright &copy; 2000-2012 Apache Software Foundation.  All Rights Reserved.</address>
347          <script src='../../../../../prettify.js' type='text/javascript'></script>
348          <script type='text/javascript'>
349            (function(){
350              var oldonload = window.onload;
351              if (typeof oldonload != 'function') {
352                window.onload = prettyPrint;
353              } else {
354                window.onload = function() {
355                  oldonload();
356                  prettyPrint();
357                }
358              }
359            })();
360          </script>
361       
362</BODY>
363</HTML>
Note: See TracBrowser for help on using the repository browser.