|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.io.file.tfile.Utils
public final class Utils
Supporting Utility classes used by TFile, and shared by users of TFile.
Nested Class Summary | |
---|---|
static class |
Utils.Version
A generic Version class. |
Method Summary | ||
---|---|---|
static
|
lowerBound(List<? extends Comparable<? super T>> list,
T key)
Lower bound binary search. |
|
static
|
lowerBound(List<? extends T> list,
T key,
Comparator<? super T> cmp)
Lower bound binary search. |
|
static String |
readString(DataInput in)
Read a String as a VInt n, followed by n Bytes in Text format. |
|
static int |
readVInt(DataInput in)
Decoding the variable-length integer. |
|
static long |
readVLong(DataInput in)
Decoding the variable-length integer. |
|
static
|
upperBound(List<? extends Comparable<? super T>> list,
T key)
Upper bound binary search. |
|
static
|
upperBound(List<? extends T> list,
T key,
Comparator<? super T> cmp)
Upper bound binary search. |
|
static void |
writeString(DataOutput out,
String s)
Write a String as a VInt n, followed by n Bytes as in Text format. |
|
static void |
writeVInt(DataOutput out,
int n)
Encoding an integer into a variable-length encoding format. |
|
static void |
writeVLong(DataOutput out,
long n)
Encoding a Long integer into a variable-length encoding format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void writeVInt(DataOutput out, int n) throws IOException
Utils#writeVLong(out, n)
.
out
- output streamn
- The integer to be encoded
IOException
writeVLong(DataOutput, long)
public static void writeVLong(DataOutput out, long n) throws IOException
out
- output streamn
- the integer number
IOException
public static int readVInt(DataInput in) throws IOException
(int)Utils#readVLong(in)
.
in
- input stream
IOException
readVLong(DataInput)
public static long readVLong(DataInput in) throws IOException
in
- input stream
IOException
public static void writeString(DataOutput out, String s) throws IOException
out
- s
-
IOException
public static String readString(DataInput in) throws IOException
in
- The input stream.
IOException
public static <T> int lowerBound(List<? extends T> list, T key, Comparator<? super T> cmp)
T
- Type of the input key.list
- The listkey
- The input key.cmp
- Comparator for the key.
public static <T> int upperBound(List<? extends T> list, T key, Comparator<? super T> cmp)
T
- Type of the input key.list
- The listkey
- The input key.cmp
- Comparator for the key.
public static <T> int lowerBound(List<? extends Comparable<? super T>> list, T key)
T
- Type of the input key.list
- The listkey
- The input key.
public static <T> int upperBound(List<? extends Comparable<? super T>> list, T key)
T
- Type of the input key.list
- The listkey
- The input key.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |