public class LazyLong extends LazyPrimitive<LazyLongObjectInspector,org.apache.hadoop.io.LongWritable>
Part of the code is adapted from Apache Harmony Project. As with the specification, this implementation relied on code laid out in Henry S. Warren, Jr.'s Hacker's Delight, (Addison Wesley, 2002) as well as The Aggregate's Magic Algorithms.
data
isNull, oi
Constructor and Description |
---|
LazyLong(LazyLong copy) |
LazyLong(LazyLongObjectInspector oi) |
Modifier and Type | Method and Description |
---|---|
void |
init(ByteArrayRef bytes,
int start,
int length)
Set the data for this LazyObjectBase.
|
static long |
parseLong(byte[] bytes,
int start,
int length)
Parses the string argument as if it was a long value and returns the
result.
|
static long |
parseLong(byte[] bytes,
int start,
int length,
int radix)
Parses the string argument as if it was an long value and returns the
result.
|
static void |
writeUTF8(OutputStream out,
long i)
Writes out the text representation of an integer using base 10 to an
OutputStream in UTF-8 encoding.
|
static void |
writeUTF8NoException(OutputStream out,
long i) |
equals, getWritableObject, hashCode, logExceptionMessage, toString
getInspector, getObject, setInspector, setNull
public LazyLong(LazyLongObjectInspector oi)
public LazyLong(LazyLong copy)
public void init(ByteArrayRef bytes, int start, int length)
LazyObjectBase
init
in interface LazyObjectBase
init
in class LazyObject<LazyLongObjectInspector>
bytes
- The wrapper of the byte[].start
- The start position inside the bytes.length
- The length of the data, starting from "start"ByteArrayRef
public static long parseLong(byte[] bytes, int start, int length)
bytes
- start
- length
- a UTF-8 encoded string representation of a long quantity.NumberFormatException
- if the argument could not be parsed as a long quantity.public static long parseLong(byte[] bytes, int start, int length, int radix)
bytes
- start
- length
- a UTF-8 encoded string representation of a long quantity.radix
- the base to use for conversion.NumberFormatException
- if the argument could not be parsed as an long quantity.public static void writeUTF8(OutputStream out, long i) throws IOException
out
- the outputstream to write toi
- an int to write outIOException
public static void writeUTF8NoException(OutputStream out, long i)
Copyright © 2017 The Apache Software Foundation. All rights reserved.