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

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

@InterfaceAudience.Private
public class UVIntTool
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 INT_7_RIGHT_BITS_SET
           
static long INT_8TH_BIT_SET
           
static byte[] MAX_VALUE_BYTES
           
 
Constructor Summary
UVIntTool()
           
 
Method Summary
static byte[] getBytes(int value)
           
static int getInt(byte[] bytes)
          bytes -> int
static int getInt(byte[] bytes, int offset)
           
static int getInt(InputStream is)
           
static int numBytes(int in)
          int -> bytes
static int writeBytes(int 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

INT_7_RIGHT_BITS_SET

public static final long INT_7_RIGHT_BITS_SET
See Also:
Constant Field Values

INT_8TH_BIT_SET

public static final long INT_8TH_BIT_SET
See Also:
Constant Field Values

MAX_VALUE_BYTES

public static final byte[] MAX_VALUE_BYTES
Constructor Detail

UVIntTool

public UVIntTool()
Method Detail

numBytes

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


getBytes

public static byte[] getBytes(int value)

writeBytes

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

getInt

public static int getInt(byte[] bytes)
bytes -> int


getInt

public static int getInt(byte[] bytes,
                         int offset)

getInt

public static int getInt(InputStream is)
                  throws IOException
Throws:
IOException


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