com.sibvisions.util.type
Class ByteUtil

java.lang.Object
  extended by com.sibvisions.util.type.ByteUtil

public final class ByteUtil
extends Object

The ByteUtil contains methods for byte(array) operations and manipulations.


Method Summary
static byte[] toByte(int pValue)
          Gets the bytes of an integer value (big endian).
static byte[] toByteLittleEndian(int pValue)
          Gets the bytes of an integer value (little endian).
static int toInt(byte[] pValue, int pStart)
          Gets the integer value of a byte array.
static int toIntLittleEndian(byte[] pValue, int pStart)
          Gets the integer value of a byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toIntLittleEndian

public static int toIntLittleEndian(byte[] pValue,
                                    int pStart)
Gets the integer value of a byte array. This method assumes little endian byte order.

Parameters:
pValue - the byte array
pStart - the start position
Returns:
the integer value

toInt

public static int toInt(byte[] pValue,
                        int pStart)
Gets the integer value of a byte array. This method assumes big endian byte order.

Parameters:
pValue - the byte array
pStart - the start position
Returns:
the integer value

toByteLittleEndian

public static byte[] toByteLittleEndian(int pValue)
Gets the bytes of an integer value (little endian).

Parameters:
pValue - the value
Returns:
the byte array (size = 4)

toByte

public static byte[] toByte(int pValue)
Gets the bytes of an integer value (big endian).

Parameters:
pValue - the value
Returns:
the byte array (size = 4)


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.