org.exist.util
Class ByteConversion

java.lang.Object
  extended byorg.exist.util.ByteConversion

public class ByteConversion
extends java.lang.Object

Description of the Class

Author:
Wolfgang Meier

Field Summary
static int BYTE
          Description of the Field
static int INT
          Description of the Field
static int LONG
          Description of the Field
static int SHORT
          Description of the Field
 
Constructor Summary
ByteConversion()
           
 
Method Summary
static int byteToInt(byte[] data, int start)
          Description of the Method
static long byteToLong(byte[] data, int start)
          Description of the Method
static short byteToShort(byte[] data, int start)
          Description of the Method
static byte[] compress(int sizeType, int i)
           
static byte[] compress(int sizeType, long l)
          Description of the Method
static int decodeLength(byte[] data, int start)
          Description of the Method
static long decompress(int sizeType, byte[] data, int start)
          Description of the Method
static java.lang.String dumpToHex(byte[] data)
          Description of the Method
static byte[] encodeNodeP(int docId, long gid)
          Description of the Method
static int getSize(int sizeType)
          Gets the size attribute of the ByteConversion class
static int getSizeType(long l)
          Gets the type attribute of the ByteConversion class
static byte[] intToByte(int v)
          Description of the Method
static byte[] intToByte(int v, byte[] data, int start)
          Description of the Method
static byte[] longToByte(long v)
          Description of the Method
static byte[] longToByte(long v, byte[] data, int start)
          Description of the Method
static byte[] shortToByte(short v)
          Description of the Method
static byte[] shortToByte(short v, byte[] data, int start)
          Description of the Method
static byte[] string2UTF8(java.lang.String s)
          Description of the Method
static byte[] trunc(byte[] data)
          Description of the Method
static byte[] truncate(byte[] data)
          Description of the Method
static java.lang.String UTF82String(byte[] data, int pointer, int len)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTE

public static final int BYTE
Description of the Field

See Also:
Constant Field Values

INT

public static final int INT
Description of the Field

See Also:
Constant Field Values

LONG

public static final int LONG
Description of the Field

See Also:
Constant Field Values

SHORT

public static final int SHORT
Description of the Field

See Also:
Constant Field Values
Constructor Detail

ByteConversion

public ByteConversion()
Method Detail

UTF82String

public static final java.lang.String UTF82String(byte[] data,
                                                 int pointer,
                                                 int len)
Description of the Method

Parameters:
data - Description of the Parameter
pointer - Description of the Parameter
len - Description of the Parameter
Returns:
Description of the Return Value

byteToInt

public static final int byteToInt(byte[] data,
                                  int start)
Description of the Method

Parameters:
data - Description of the Parameter
start - Description of the Parameter
Returns:
Description of the Return Value

byteToLong

public static final long byteToLong(byte[] data,
                                    int start)
Description of the Method

Parameters:
data - Description of the Parameter
start - Description of the Parameter
Returns:
Description of the Return Value

byteToShort

public static final short byteToShort(byte[] data,
                                      int start)
Description of the Method

Parameters:
data - Description of the Parameter
start - Description of the Parameter
Returns:
Description of the Return Value

compress

public static byte[] compress(int sizeType,
                              long l)
Description of the Method

Parameters:
l - Description of the Parameter
sizeType - Description of the Parameter
Returns:
Description of the Return Value

compress

public static byte[] compress(int sizeType,
                              int i)

decodeLength

public static final int decodeLength(byte[] data,
                                     int start)
Description of the Method

Parameters:
data - Description of the Parameter
start - Description of the Parameter
Returns:
Description of the Return Value

decompress

public static long decompress(int sizeType,
                              byte[] data,
                              int start)
Description of the Method

Parameters:
sizeType - Description of the Parameter
data - Description of the Parameter
start - Description of the Parameter
Returns:
Description of the Return Value

dumpToHex

public static final java.lang.String dumpToHex(byte[] data)
Description of the Method

Parameters:
data - Description of the Parameter
Returns:
Description of the Return Value

encodeNodeP

public static final byte[] encodeNodeP(int docId,
                                       long gid)
Description of the Method

Parameters:
docId - Description of the Parameter
gid - Description of the Parameter
Returns:
Description of the Return Value

getSize

public static int getSize(int sizeType)
Gets the size attribute of the ByteConversion class

Parameters:
sizeType - Description of the Parameter
Returns:
The size value

getSizeType

public static int getSizeType(long l)
Gets the type attribute of the ByteConversion class

Parameters:
l - Description of the Parameter
Returns:
The type value

intToByte

public static final byte[] intToByte(int v,
                                     byte[] data,
                                     int start)
Description of the Method

Parameters:
v - Description of the Parameter
data - Description of the Parameter
start - Description of the Parameter
Returns:
Description of the Return Value

intToByte

public static final byte[] intToByte(int v)
Description of the Method

Parameters:
v - Description of the Parameter
Returns:
Description of the Return Value

longToByte

public static final byte[] longToByte(long v,
                                      byte[] data,
                                      int start)
Description of the Method

Parameters:
v - Description of the Parameter
data - Description of the Parameter
start - Description of the Parameter
Returns:
Description of the Return Value

longToByte

public static final byte[] longToByte(long v)
Description of the Method

Parameters:
v - Description of the Parameter
Returns:
Description of the Return Value

shortToByte

public static final byte[] shortToByte(short v,
                                       byte[] data,
                                       int start)
Description of the Method

Parameters:
v - Description of the Parameter
data - Description of the Parameter
start - Description of the Parameter
Returns:
Description of the Return Value

shortToByte

public static final byte[] shortToByte(short v)
Description of the Method

Parameters:
v - Description of the Parameter
Returns:
Description of the Return Value

string2UTF8

public static final byte[] string2UTF8(java.lang.String s)
Description of the Method

Parameters:
s - Description of the Parameter
Returns:
Description of the Return Value

trunc

public static final byte[] trunc(byte[] data)
Description of the Method

Parameters:
data - Description of the Parameter
Returns:
Description of the Return Value

truncate

public static final byte[] truncate(byte[] data)
Description of the Method

Parameters:
data - Description of the Parameter
Returns:
Description of the Return Value


Copyright (C) Wolfgang Meier. All rights reserved.