org.apache.hadoop.hbase.util.vint
Class UVLongTool

java.lang.Object
  extended by org.apache.hadoop.hbase.util.vint.UVLongTool

@InterfaceAudience.Private
public class UVLongTool
extends Object

Simple Variable Length Integer encoding. Left bit of 0 means we are on the last byte. If left bit of the current byte is 1, then there is at least one more byte.


Field Summary
static byte BYTE_7_RIGHT_BITS_SET
           
static byte BYTE_LEFT_BIT_SET
           
static long LONG_7_RIGHT_BITS_SET
           
static long LONG_8TH_BIT_SET
           
static byte[] MAX_VALUE_BYTES
           
 
Constructor Summary
UVLongTool()
           
 
Method Summary
static byte[] getBytes(long value)
           
static long getLong(byte[] bytes)
          bytes -> long
static long getLong(byte[] bytes, int offset)
           
static long getLong(InputStream is)
           
static int numBytes(long in)
          long -> bytes
static int writeBytes(long value, OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTE_7_RIGHT_BITS_SET

public static final byte BYTE_7_RIGHT_BITS_SET
See Also:
Constant Field Values

BYTE_LEFT_BIT_SET

public static final byte BYTE_LEFT_BIT_SET
See Also:
Constant Field Values

LONG_7_RIGHT_BITS_SET

public static final long LONG_7_RIGHT_BITS_SET
See Also:
Constant Field Values

LONG_8TH_BIT_SET

public static final long LONG_8TH_BIT_SET
See Also:
Constant Field Values

MAX_VALUE_BYTES

public static final byte[] MAX_VALUE_BYTES
Constructor Detail

UVLongTool

public UVLongTool()
Method Detail

numBytes

public static int numBytes(long in)
long -> bytes


getBytes

public static byte[] getBytes(long value)

writeBytes

public static int writeBytes(long value,
                             OutputStream os)
                      throws IOException
Throws:
IOException

getLong

public static long getLong(byte[] bytes)
bytes -> long


getLong

public static long getLong(byte[] bytes,
                           int offset)

getLong

public static long getLong(InputStream is)
                    throws IOException
Throws:
IOException


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.