[120] | 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 | Utils (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="Utils (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/Utils.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/io/file/tfile/TFile.Writer.html" title="class in org.apache.hadoop.io.file.tfile"><B>PREV CLASS</B></A> |
---|
| 59 | <A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.Version.html" title="class in org.apache.hadoop.io.file.tfile"><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/file/tfile/Utils.html" target="_top"><B>FRAMES</B></A> |
---|
| 62 | <A HREF="Utils.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: <A HREF="#nested_class_summary">NESTED</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
| 80 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 81 | DETAIL: FIELD | CONSTR | <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.io.file.tfile</FONT> |
---|
| 92 | <BR> |
---|
| 93 | Class Utils</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.io.file.tfile.Utils</B> |
---|
| 97 | </PRE> |
---|
| 98 | <HR> |
---|
| 99 | <DL> |
---|
| 100 | <DT><PRE>public final class <B>Utils</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></DL> |
---|
| 101 | </PRE> |
---|
| 102 | |
---|
| 103 | <P> |
---|
| 104 | Supporting Utility classes used by TFile, and shared by users of TFile. |
---|
| 105 | <P> |
---|
| 106 | |
---|
| 107 | <P> |
---|
| 108 | <HR> |
---|
| 109 | |
---|
| 110 | <P> |
---|
| 111 | <!-- ======== NESTED CLASS SUMMARY ======== --> |
---|
| 112 | |
---|
| 113 | <A NAME="nested_class_summary"><!-- --></A> |
---|
| 114 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 115 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 116 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
| 117 | <B>Nested Class Summary</B></FONT></TH> |
---|
| 118 | </TR> |
---|
| 119 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 120 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 121 | <CODE>static class</CODE></FONT></TD> |
---|
| 122 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.Version.html" title="class in org.apache.hadoop.io.file.tfile">Utils.Version</A></B></CODE> |
---|
| 123 | |
---|
| 124 | <BR> |
---|
| 125 | A generic Version class.</TD> |
---|
| 126 | </TR> |
---|
| 127 | </TABLE> |
---|
| 128 | |
---|
| 129 | <!-- ========== METHOD SUMMARY =========== --> |
---|
| 130 | |
---|
| 131 | <A NAME="method_summary"><!-- --></A> |
---|
| 132 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 133 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 134 | <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
---|
| 135 | <B>Method Summary</B></FONT></TH> |
---|
| 136 | </TR> |
---|
| 137 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 138 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 139 | <CODE>static |
---|
| 140 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
---|
| 141 | <TR ALIGN="right" VALIGN=""> |
---|
| 142 | <TD NOWRAP><FONT SIZE="-1"> |
---|
| 143 | <CODE><T> int</CODE></FONT></TD> |
---|
| 144 | </TR> |
---|
| 145 | </TABLE> |
---|
| 146 | </CODE></FONT></TD> |
---|
| 147 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#lowerBound(java.util.List, T)">lowerBound</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><? extends <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><? super T>> list, |
---|
| 148 | T key)</CODE> |
---|
| 149 | |
---|
| 150 | <BR> |
---|
| 151 | Lower bound binary search.</TD> |
---|
| 152 | </TR> |
---|
| 153 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 154 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 155 | <CODE>static |
---|
| 156 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
---|
| 157 | <TR ALIGN="right" VALIGN=""> |
---|
| 158 | <TD NOWRAP><FONT SIZE="-1"> |
---|
| 159 | <CODE><T> int</CODE></FONT></TD> |
---|
| 160 | </TR> |
---|
| 161 | </TABLE> |
---|
| 162 | </CODE></FONT></TD> |
---|
| 163 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#lowerBound(java.util.List, T, java.util.Comparator)">lowerBound</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><? extends T> list, |
---|
| 164 | T key, |
---|
| 165 | <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A><? super T> cmp)</CODE> |
---|
| 166 | |
---|
| 167 | <BR> |
---|
| 168 | Lower bound binary search.</TD> |
---|
| 169 | </TR> |
---|
| 170 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 171 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 172 | <CODE>static <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> |
---|
| 173 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#readString(java.io.DataInput)">readString</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> in)</CODE> |
---|
| 174 | |
---|
| 175 | <BR> |
---|
| 176 | Read a String as a VInt n, followed by n Bytes in Text format.</TD> |
---|
| 177 | </TR> |
---|
| 178 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 179 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 180 | <CODE>static int</CODE></FONT></TD> |
---|
| 181 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#readVInt(java.io.DataInput)">readVInt</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> in)</CODE> |
---|
| 182 | |
---|
| 183 | <BR> |
---|
| 184 | Decoding the variable-length integer.</TD> |
---|
| 185 | </TR> |
---|
| 186 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 187 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 188 | <CODE>static long</CODE></FONT></TD> |
---|
| 189 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#readVLong(java.io.DataInput)">readVLong</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> in)</CODE> |
---|
| 190 | |
---|
| 191 | <BR> |
---|
| 192 | Decoding the variable-length integer.</TD> |
---|
| 193 | </TR> |
---|
| 194 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 195 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 196 | <CODE>static |
---|
| 197 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
---|
| 198 | <TR ALIGN="right" VALIGN=""> |
---|
| 199 | <TD NOWRAP><FONT SIZE="-1"> |
---|
| 200 | <CODE><T> int</CODE></FONT></TD> |
---|
| 201 | </TR> |
---|
| 202 | </TABLE> |
---|
| 203 | </CODE></FONT></TD> |
---|
| 204 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#upperBound(java.util.List, T)">upperBound</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><? extends <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><? super T>> list, |
---|
| 205 | T key)</CODE> |
---|
| 206 | |
---|
| 207 | <BR> |
---|
| 208 | Upper bound binary search.</TD> |
---|
| 209 | </TR> |
---|
| 210 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 211 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 212 | <CODE>static |
---|
| 213 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
---|
| 214 | <TR ALIGN="right" VALIGN=""> |
---|
| 215 | <TD NOWRAP><FONT SIZE="-1"> |
---|
| 216 | <CODE><T> int</CODE></FONT></TD> |
---|
| 217 | </TR> |
---|
| 218 | </TABLE> |
---|
| 219 | </CODE></FONT></TD> |
---|
| 220 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#upperBound(java.util.List, T, java.util.Comparator)">upperBound</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><? extends T> list, |
---|
| 221 | T key, |
---|
| 222 | <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A><? super T> cmp)</CODE> |
---|
| 223 | |
---|
| 224 | <BR> |
---|
| 225 | Upper bound binary search.</TD> |
---|
| 226 | </TR> |
---|
| 227 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 228 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 229 | <CODE>static void</CODE></FONT></TD> |
---|
| 230 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#writeString(java.io.DataOutput, java.lang.String)">writeString</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> out, |
---|
| 231 | <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> s)</CODE> |
---|
| 232 | |
---|
| 233 | <BR> |
---|
| 234 | Write a String as a VInt n, followed by n Bytes as in Text format.</TD> |
---|
| 235 | </TR> |
---|
| 236 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 237 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 238 | <CODE>static void</CODE></FONT></TD> |
---|
| 239 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#writeVInt(java.io.DataOutput, int)">writeVInt</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> out, |
---|
| 240 | int n)</CODE> |
---|
| 241 | |
---|
| 242 | <BR> |
---|
| 243 | Encoding an integer into a variable-length encoding format.</TD> |
---|
| 244 | </TR> |
---|
| 245 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 246 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
---|
| 247 | <CODE>static void</CODE></FONT></TD> |
---|
| 248 | <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#writeVLong(java.io.DataOutput, long)">writeVLong</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> out, |
---|
| 249 | long n)</CODE> |
---|
| 250 | |
---|
| 251 | <BR> |
---|
| 252 | Encoding a Long integer into a variable-length encoding format.</TD> |
---|
| 253 | </TR> |
---|
| 254 | </TABLE> |
---|
| 255 | <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
---|
| 256 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 257 | <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
---|
| 258 | <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> |
---|
| 259 | </TR> |
---|
| 260 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
---|
| 261 | <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#equals(java.lang.Object)" title="class or interface in java.lang">equals</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#hashCode()" title="class or interface in java.lang">hashCode</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#toString()" title="class or interface in java.lang">toString</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> |
---|
| 262 | </TR> |
---|
| 263 | </TABLE> |
---|
| 264 | |
---|
| 265 | <P> |
---|
| 266 | |
---|
| 267 | <!-- ============ METHOD DETAIL ========== --> |
---|
| 268 | |
---|
| 269 | <A NAME="method_detail"><!-- --></A> |
---|
| 270 | <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
---|
| 271 | <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
---|
| 272 | <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
---|
| 273 | <B>Method Detail</B></FONT></TH> |
---|
| 274 | </TR> |
---|
| 275 | </TABLE> |
---|
| 276 | |
---|
| 277 | <A NAME="writeVInt(java.io.DataOutput, int)"><!-- --></A><H3> |
---|
| 278 | writeVInt</H3> |
---|
| 279 | <PRE> |
---|
| 280 | public static void <B>writeVInt</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> out, |
---|
| 281 | int n) |
---|
| 282 | 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> |
---|
| 283 | <DL> |
---|
| 284 | <DD>Encoding an integer into a variable-length encoding format. Synonymous to |
---|
| 285 | <code>Utils#writeVLong(out, n)</code>. |
---|
| 286 | <P> |
---|
| 287 | <DD><DL> |
---|
| 288 | <DT><B>Parameters:</B><DD><CODE>out</CODE> - output stream<DD><CODE>n</CODE> - The integer to be encoded |
---|
| 289 | <DT><B>Throws:</B> |
---|
| 290 | <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><DT><B>See Also:</B><DD><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#writeVLong(java.io.DataOutput, long)"><CODE>writeVLong(DataOutput, long)</CODE></A></DL> |
---|
| 291 | </DD> |
---|
| 292 | </DL> |
---|
| 293 | <HR> |
---|
| 294 | |
---|
| 295 | <A NAME="writeVLong(java.io.DataOutput, long)"><!-- --></A><H3> |
---|
| 296 | writeVLong</H3> |
---|
| 297 | <PRE> |
---|
| 298 | public static void <B>writeVLong</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> out, |
---|
| 299 | long n) |
---|
| 300 | 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> |
---|
| 301 | <DL> |
---|
| 302 | <DD>Encoding a Long integer into a variable-length encoding format. |
---|
| 303 | <ul> |
---|
| 304 | <li>if n in [-32, 127): encode in one byte with the actual value. |
---|
| 305 | Otherwise, |
---|
| 306 | <li>if n in [-20*2^8, 20*2^8): encode in two bytes: byte[0] = n/256 - 52; |
---|
| 307 | byte[1]=n&0xff. Otherwise, |
---|
| 308 | <li>if n IN [-16*2^16, 16*2^16): encode in three bytes: byte[0]=n/2^16 - |
---|
| 309 | 88; byte[1]=(n>>8)&0xff; byte[2]=n&0xff. Otherwise, |
---|
| 310 | <li>if n in [-8*2^24, 8*2^24): encode in four bytes: byte[0]=n/2^24 - 112; |
---|
| 311 | byte[1] = (n>>16)&0xff; byte[2] = (n>>8)&0xff; byte[3]=n&0xff. Otherwise: |
---|
| 312 | <li>if n in [-2^31, 2^31): encode in five bytes: byte[0]=-125; byte[1] = |
---|
| 313 | (n>>24)&0xff; byte[2]=(n>>16)&0xff; byte[3]=(n>>8)&0xff; byte[4]=n&0xff; |
---|
| 314 | <li>if n in [-2^39, 2^39): encode in six bytes: byte[0]=-124; byte[1] = |
---|
| 315 | (n>>32)&0xff; byte[2]=(n>>24)&0xff; byte[3]=(n>>16)&0xff; |
---|
| 316 | byte[4]=(n>>8)&0xff; byte[5]=n&0xff |
---|
| 317 | <li>if n in [-2^47, 2^47): encode in seven bytes: byte[0]=-123; byte[1] = |
---|
| 318 | (n>>40)&0xff; byte[2]=(n>>32)&0xff; byte[3]=(n>>24)&0xff; |
---|
| 319 | byte[4]=(n>>16)&0xff; byte[5]=(n>>8)&0xff; byte[6]=n&0xff; |
---|
| 320 | <li>if n in [-2^55, 2^55): encode in eight bytes: byte[0]=-122; byte[1] = |
---|
| 321 | (n>>48)&0xff; byte[2] = (n>>40)&0xff; byte[3]=(n>>32)&0xff; |
---|
| 322 | byte[4]=(n>>24)&0xff; byte[5]=(n>>16)&0xff; byte[6]=(n>>8)&0xff; |
---|
| 323 | byte[7]=n&0xff; |
---|
| 324 | <li>if n in [-2^63, 2^63): encode in nine bytes: byte[0]=-121; byte[1] = |
---|
| 325 | (n>>54)&0xff; byte[2] = (n>>48)&0xff; byte[3] = (n>>40)&0xff; |
---|
| 326 | byte[4]=(n>>32)&0xff; byte[5]=(n>>24)&0xff; byte[6]=(n>>16)&0xff; |
---|
| 327 | byte[7]=(n>>8)&0xff; byte[8]=n&0xff; |
---|
| 328 | </ul> |
---|
| 329 | <P> |
---|
| 330 | <DD><DL> |
---|
| 331 | <DT><B>Parameters:</B><DD><CODE>out</CODE> - output stream<DD><CODE>n</CODE> - the integer number |
---|
| 332 | <DT><B>Throws:</B> |
---|
| 333 | <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> |
---|
| 334 | </DD> |
---|
| 335 | </DL> |
---|
| 336 | <HR> |
---|
| 337 | |
---|
| 338 | <A NAME="readVInt(java.io.DataInput)"><!-- --></A><H3> |
---|
| 339 | readVInt</H3> |
---|
| 340 | <PRE> |
---|
| 341 | public static int <B>readVInt</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> in) |
---|
| 342 | 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> |
---|
| 343 | <DL> |
---|
| 344 | <DD>Decoding the variable-length integer. Synonymous to |
---|
| 345 | <code>(int)Utils#readVLong(in)</code>. |
---|
| 346 | <P> |
---|
| 347 | <DD><DL> |
---|
| 348 | <DT><B>Parameters:</B><DD><CODE>in</CODE> - input stream |
---|
| 349 | <DT><B>Returns:</B><DD>the decoded integer |
---|
| 350 | <DT><B>Throws:</B> |
---|
| 351 | <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><DT><B>See Also:</B><DD><A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.html#readVLong(java.io.DataInput)"><CODE>readVLong(DataInput)</CODE></A></DL> |
---|
| 352 | </DD> |
---|
| 353 | </DL> |
---|
| 354 | <HR> |
---|
| 355 | |
---|
| 356 | <A NAME="readVLong(java.io.DataInput)"><!-- --></A><H3> |
---|
| 357 | readVLong</H3> |
---|
| 358 | <PRE> |
---|
| 359 | public static long <B>readVLong</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> in) |
---|
| 360 | 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> |
---|
| 361 | <DL> |
---|
| 362 | <DD>Decoding the variable-length integer. Suppose the value of the first byte |
---|
| 363 | is FB, and the following bytes are NB[*]. |
---|
| 364 | <ul> |
---|
| 365 | <li>if (FB >= -32), return (long)FB; |
---|
| 366 | <li>if (FB in [-72, -33]), return (FB+52)<<8 + NB[0]&0xff; |
---|
| 367 | <li>if (FB in [-104, -73]), return (FB+88)<<16 + (NB[0]&0xff)<<8 + |
---|
| 368 | NB[1]&0xff; |
---|
| 369 | <li>if (FB in [-120, -105]), return (FB+112)<<24 + (NB[0]&0xff)<<16 + |
---|
| 370 | (NB[1]&0xff)<<8 + NB[2]&0xff; |
---|
| 371 | <li>if (FB in [-128, -121]), return interpret NB[FB+129] as a signed |
---|
| 372 | big-endian integer. |
---|
| 373 | <P> |
---|
| 374 | <DD><DL> |
---|
| 375 | <DT><B>Parameters:</B><DD><CODE>in</CODE> - input stream |
---|
| 376 | <DT><B>Returns:</B><DD>the decoded long integer. |
---|
| 377 | <DT><B>Throws:</B> |
---|
| 378 | <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> |
---|
| 379 | </DD> |
---|
| 380 | </DL> |
---|
| 381 | <HR> |
---|
| 382 | |
---|
| 383 | <A NAME="writeString(java.io.DataOutput, java.lang.String)"><!-- --></A><H3> |
---|
| 384 | writeString</H3> |
---|
| 385 | <PRE> |
---|
| 386 | public static void <B>writeString</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> out, |
---|
| 387 | <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> s) |
---|
| 388 | 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> |
---|
| 389 | <DL> |
---|
| 390 | <DD>Write a String as a VInt n, followed by n Bytes as in Text format. |
---|
| 391 | <P> |
---|
| 392 | <DD><DL> |
---|
| 393 | <DT><B>Parameters:</B><DD><CODE>out</CODE> - <DD><CODE>s</CODE> - |
---|
| 394 | <DT><B>Throws:</B> |
---|
| 395 | <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> |
---|
| 396 | </DD> |
---|
| 397 | </DL> |
---|
| 398 | <HR> |
---|
| 399 | |
---|
| 400 | <A NAME="readString(java.io.DataInput)"><!-- --></A><H3> |
---|
| 401 | readString</H3> |
---|
| 402 | <PRE> |
---|
| 403 | public static <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>readString</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> in) |
---|
| 404 | 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> |
---|
| 405 | <DL> |
---|
| 406 | <DD>Read a String as a VInt n, followed by n Bytes in Text format. |
---|
| 407 | <P> |
---|
| 408 | <DD><DL> |
---|
| 409 | <DT><B>Parameters:</B><DD><CODE>in</CODE> - The input stream. |
---|
| 410 | <DT><B>Returns:</B><DD>The string |
---|
| 411 | <DT><B>Throws:</B> |
---|
| 412 | <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> |
---|
| 413 | </DD> |
---|
| 414 | </DL> |
---|
| 415 | <HR> |
---|
| 416 | |
---|
| 417 | <A NAME="lowerBound(java.util.List,java.lang.Object,java.util.Comparator)"><!-- --></A><A NAME="lowerBound(java.util.List, T, java.util.Comparator)"><!-- --></A><H3> |
---|
| 418 | lowerBound</H3> |
---|
| 419 | <PRE> |
---|
| 420 | public static <T> int <B>lowerBound</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><? extends T> list, |
---|
| 421 | T key, |
---|
| 422 | <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A><? super T> cmp)</PRE> |
---|
| 423 | <DL> |
---|
| 424 | <DD>Lower bound binary search. Find the index to the first element in the list |
---|
| 425 | that compares greater than or equal to key. |
---|
| 426 | <P> |
---|
| 427 | <DD><DL> |
---|
| 428 | <DT><B>Type Parameters:</B><DD><CODE>T</CODE> - Type of the input key.<DT><B>Parameters:</B><DD><CODE>list</CODE> - The list<DD><CODE>key</CODE> - The input key.<DD><CODE>cmp</CODE> - Comparator for the key. |
---|
| 429 | <DT><B>Returns:</B><DD>The index to the desired element if it exists; or list.size() |
---|
| 430 | otherwise.</DL> |
---|
| 431 | </DD> |
---|
| 432 | </DL> |
---|
| 433 | <HR> |
---|
| 434 | |
---|
| 435 | <A NAME="upperBound(java.util.List,java.lang.Object,java.util.Comparator)"><!-- --></A><A NAME="upperBound(java.util.List, T, java.util.Comparator)"><!-- --></A><H3> |
---|
| 436 | upperBound</H3> |
---|
| 437 | <PRE> |
---|
| 438 | public static <T> int <B>upperBound</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><? extends T> list, |
---|
| 439 | T key, |
---|
| 440 | <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</A><? super T> cmp)</PRE> |
---|
| 441 | <DL> |
---|
| 442 | <DD>Upper bound binary search. Find the index to the first element in the list |
---|
| 443 | that compares greater than the input key. |
---|
| 444 | <P> |
---|
| 445 | <DD><DL> |
---|
| 446 | <DT><B>Type Parameters:</B><DD><CODE>T</CODE> - Type of the input key.<DT><B>Parameters:</B><DD><CODE>list</CODE> - The list<DD><CODE>key</CODE> - The input key.<DD><CODE>cmp</CODE> - Comparator for the key. |
---|
| 447 | <DT><B>Returns:</B><DD>The index to the desired element if it exists; or list.size() |
---|
| 448 | otherwise.</DL> |
---|
| 449 | </DD> |
---|
| 450 | </DL> |
---|
| 451 | <HR> |
---|
| 452 | |
---|
| 453 | <A NAME="lowerBound(java.util.List,java.lang.Object)"><!-- --></A><A NAME="lowerBound(java.util.List, T)"><!-- --></A><H3> |
---|
| 454 | lowerBound</H3> |
---|
| 455 | <PRE> |
---|
| 456 | public static <T> int <B>lowerBound</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><? extends <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><? super T>> list, |
---|
| 457 | T key)</PRE> |
---|
| 458 | <DL> |
---|
| 459 | <DD>Lower bound binary search. Find the index to the first element in the list |
---|
| 460 | that compares greater than or equal to key. |
---|
| 461 | <P> |
---|
| 462 | <DD><DL> |
---|
| 463 | <DT><B>Type Parameters:</B><DD><CODE>T</CODE> - Type of the input key.<DT><B>Parameters:</B><DD><CODE>list</CODE> - The list<DD><CODE>key</CODE> - The input key. |
---|
| 464 | <DT><B>Returns:</B><DD>The index to the desired element if it exists; or list.size() |
---|
| 465 | otherwise.</DL> |
---|
| 466 | </DD> |
---|
| 467 | </DL> |
---|
| 468 | <HR> |
---|
| 469 | |
---|
| 470 | <A NAME="upperBound(java.util.List,java.lang.Object)"><!-- --></A><A NAME="upperBound(java.util.List, T)"><!-- --></A><H3> |
---|
| 471 | upperBound</H3> |
---|
| 472 | <PRE> |
---|
| 473 | public static <T> int <B>upperBound</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><? extends <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><? super T>> list, |
---|
| 474 | T key)</PRE> |
---|
| 475 | <DL> |
---|
| 476 | <DD>Upper bound binary search. Find the index to the first element in the list |
---|
| 477 | that compares greater than the input key. |
---|
| 478 | <P> |
---|
| 479 | <DD><DL> |
---|
| 480 | <DT><B>Type Parameters:</B><DD><CODE>T</CODE> - Type of the input key.<DT><B>Parameters:</B><DD><CODE>list</CODE> - The list<DD><CODE>key</CODE> - The input key. |
---|
| 481 | <DT><B>Returns:</B><DD>The index to the desired element if it exists; or list.size() |
---|
| 482 | otherwise.</DL> |
---|
| 483 | </DD> |
---|
| 484 | </DL> |
---|
| 485 | <!-- ========= END OF CLASS DATA ========= --> |
---|
| 486 | <HR> |
---|
| 487 | |
---|
| 488 | |
---|
| 489 | <!-- ======= START OF BOTTOM NAVBAR ====== --> |
---|
| 490 | <A NAME="navbar_bottom"><!-- --></A> |
---|
| 491 | <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
---|
| 492 | <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
---|
| 493 | <TR> |
---|
| 494 | <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
---|
| 495 | <A NAME="navbar_bottom_firstrow"><!-- --></A> |
---|
| 496 | <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
---|
| 497 | <TR ALIGN="center" VALIGN="top"> |
---|
| 498 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
---|
| 499 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
---|
| 500 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
---|
| 501 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Utils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
---|
| 502 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
---|
| 503 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
---|
| 504 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
---|
| 505 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
---|
| 506 | </TR> |
---|
| 507 | </TABLE> |
---|
| 508 | </TD> |
---|
| 509 | <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
---|
| 510 | </EM> |
---|
| 511 | </TD> |
---|
| 512 | </TR> |
---|
| 513 | |
---|
| 514 | <TR> |
---|
| 515 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
| 516 | <A HREF="../../../../../../org/apache/hadoop/io/file/tfile/TFile.Writer.html" title="class in org.apache.hadoop.io.file.tfile"><B>PREV CLASS</B></A> |
---|
| 517 | <A HREF="../../../../../../org/apache/hadoop/io/file/tfile/Utils.Version.html" title="class in org.apache.hadoop.io.file.tfile"><B>NEXT CLASS</B></A></FONT></TD> |
---|
| 518 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
---|
| 519 | <A HREF="../../../../../../index.html?org/apache/hadoop/io/file/tfile/Utils.html" target="_top"><B>FRAMES</B></A> |
---|
| 520 | <A HREF="Utils.html" target="_top"><B>NO FRAMES</B></A> |
---|
| 521 | <SCRIPT type="text/javascript"> |
---|
| 522 | <!-- |
---|
| 523 | if(window==top) { |
---|
| 524 | document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
---|
| 525 | } |
---|
| 526 | //--> |
---|
| 527 | </SCRIPT> |
---|
| 528 | <NOSCRIPT> |
---|
| 529 | <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> |
---|
| 530 | </NOSCRIPT> |
---|
| 531 | |
---|
| 532 | |
---|
| 533 | </FONT></TD> |
---|
| 534 | </TR> |
---|
| 535 | <TR> |
---|
| 536 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 537 | SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
---|
| 538 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
---|
| 539 | DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
---|
| 540 | </TR> |
---|
| 541 | </TABLE> |
---|
| 542 | <A NAME="skip-navbar_bottom"></A> |
---|
| 543 | <!-- ======== END OF BOTTOM NAVBAR ======= --> |
---|
| 544 | |
---|
| 545 | <HR> |
---|
| 546 | Copyright © 2009 The Apache Software Foundation |
---|
| 547 | </BODY> |
---|
| 548 | </HTML> |
---|