Package org.apache.hadoop.record
Class Utils
java.lang.Object
org.apache.hadoop.record.Utils
Deprecated.
Replaced by Avro.
Various utility functions for Hadoop record I/O runtime.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompareBytes(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) Deprecated.Lexicographic order of binary data.static intgetVIntSize(long i) Deprecated.Get the encoded length if an integer is stored in a variable-length formatstatic doublereadDouble(byte[] bytes, int start) Deprecated.Parse a double from a byte array.static floatreadFloat(byte[] bytes, int start) Deprecated.Parse a float from a byte array.static intreadVInt(byte[] bytes, int start) Deprecated.Reads a zero-compressed encoded integer from a byte array and returns it.static intDeprecated.Reads a zero-compressed encoded integer from a stream and returns it.static longreadVLong(byte[] bytes, int start) Deprecated.Reads a zero-compressed encoded long from a byte array and returns it.static longDeprecated.Reads a zero-compressed encoded long from a stream and return it.static voidwriteVInt(DataOutput stream, int i) Deprecated.Serializes an int to a binary stream with zero-compressed encoding.static voidwriteVLong(DataOutput stream, long i) Deprecated.Serializes a long to a binary stream with zero-compressed encoding.
-
Field Details
-
hexchars
public static final char[] hexcharsDeprecated.
-
-
Method Details
-
readFloat
public static float readFloat(byte[] bytes, int start) Deprecated.Parse a float from a byte array. -
readDouble
public static double readDouble(byte[] bytes, int start) Deprecated.Parse a double from a byte array. -
readVLong
Deprecated.Reads a zero-compressed encoded long from a byte array and returns it.- Parameters:
bytes- byte array with decode longstart- starting index- Returns:
- deserialized long
- Throws:
IOException
-
readVInt
Deprecated.Reads a zero-compressed encoded integer from a byte array and returns it.- Parameters:
bytes- byte array with the encoded integerstart- start index- Returns:
- deserialized integer
- Throws:
IOException
-
readVLong
Deprecated.Reads a zero-compressed encoded long from a stream and return it.- Parameters:
in- input stream- Returns:
- deserialized long
- Throws:
IOException
-
readVInt
Deprecated.Reads a zero-compressed encoded integer from a stream and returns it.- Parameters:
in- input stream- Returns:
- deserialized integer
- Throws:
IOException
-
getVIntSize
public static int getVIntSize(long i) Deprecated.Get the encoded length if an integer is stored in a variable-length format- Returns:
- the encoded length
-
writeVLong
Deprecated.Serializes a long to a binary stream with zero-compressed encoding. For -112 <= i <= 127, only one byte is used with the actual value. For other values of i, the first byte value indicates whether the long is positive or negative, and the number of bytes that follow. If the first byte value v is between -113 and -120, the following long is positive, with number of bytes that follow are -(v+112). If the first byte value v is between -121 and -128, the following long is negative, with number of bytes that follow are -(v+120). Bytes are stored in the high-non-zero-byte-first order.- Parameters:
stream- Binary output streami- Long to be serialized- Throws:
IOException
-
writeVInt
Deprecated.Serializes an int to a binary stream with zero-compressed encoding.- Parameters:
stream- Binary output streami- int to be serialized- Throws:
IOException
-
compareBytes
public static int compareBytes(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) Deprecated.Lexicographic order of binary data.
-