public final class LazyUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static int |
compare(byte[] b1,
int start1,
int length1,
byte[] b2,
int start2,
int length2)
Returns -1 if the first byte sequence is lexicographically less than the
second; returns +1 if the second byte sequence is lexicographically less
than the first; otherwise return 0.
|
static java.lang.String |
convertToString(byte[] bytes,
int start,
int length)
Convert a UTF-8 byte array to String.
|
static byte[] |
createByteArray(BytesWritable sourceBw)
gets a byte[] with copy of data from source BytesWritable
|
static int |
digit(int b,
int radix)
Returns the digit represented by character b.
|
static void |
extractColumnInfo(java.util.Properties tbl,
LazySimpleSerDe.SerDeParameters serdeParams,
java.lang.String serdeName) |
static int |
hashBytes(byte[] data,
int start,
int len) |
static void |
writePrimitive(java.io.OutputStream out,
java.lang.Object o,
PrimitiveObjectInspector oi)
Write out a binary representation of a PrimitiveObject to a byte stream.
|
static void |
writePrimitiveUTF8(java.io.OutputStream out,
java.lang.Object o,
PrimitiveObjectInspector oi,
boolean escaped,
byte escapeChar,
boolean[] needsEscape)
Write out the text representation of a Primitive Object to a UTF8 byte
stream.
|
public static int digit(int b,
int radix)
b - The ascii code of the characterradix - The radixpublic static int compare(byte[] b1,
int start1,
int length1,
byte[] b2,
int start2,
int length2)
public static java.lang.String convertToString(byte[] bytes,
int start,
int length)
bytes - The byte[] containing the UTF-8 String.start - The start position inside the bytes.length - The length of the data, starting from "start"public static void writePrimitiveUTF8(java.io.OutputStream out,
java.lang.Object o,
PrimitiveObjectInspector oi,
boolean escaped,
byte escapeChar,
boolean[] needsEscape)
throws java.io.IOException
out - The UTF8 byte OutputStreamo - The primitive ObjectneedsEscape - Whether a character needs escaping. This array should have size of
128.java.io.IOExceptionpublic static void writePrimitive(java.io.OutputStream out,
java.lang.Object o,
PrimitiveObjectInspector oi)
throws java.io.IOException
out - ByteStream.Output, an unsynchronized version of ByteArrayOutputStream, used as a
backing buffer for the the DataOutputStreamo - the PrimitiveObjectoi - the PrimitiveObjectInspectorjava.io.IOException - on error during the write operationpublic static int hashBytes(byte[] data,
int start,
int len)
public static void extractColumnInfo(java.util.Properties tbl,
LazySimpleSerDe.SerDeParameters serdeParams,
java.lang.String serdeName)
throws SerDeException
SerDeExceptionpublic static byte[] createByteArray(BytesWritable sourceBw)
sourceBw - - source BytesWritableCopyright © 2012 The Apache Software Foundation