com.camelspotting.jotl.udp
Class BitUtil

java.lang.Object
  extended by com.camelspotting.jotl.udp.BitUtil

public class BitUtil
extends Object


Method Summary
static int parse16BitNumber(byte[] input, int offset)
          Method for parsing 2 bytes.
static int parse32BitNumber(byte[] input, int offset)
          Method for parsing 4 bytes.
static long parse64BitNumber(byte[] input, int offset)
          Method for parsing 16 bytes.
static int parse8BitNumber(byte[] input, int offset)
          Method for parsing 1 byte.
static int toUnsignedInt(byte v)
           
static int[] toUnsignedIntegers(byte[] b)
           
static long[] toUnsignedLongs(byte[] b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parse64BitNumber

public static long parse64BitNumber(byte[] input,
                                    int offset)
Method for parsing 16 bytes.

Parameters:
input - where to find the bytes
offset - where to start
Returns:
the number.

parse32BitNumber

public static int parse32BitNumber(byte[] input,
                                   int offset)
Method for parsing 4 bytes.

Parameters:
input - where to find the bytes
offset - where to start
Returns:
the number.

parse16BitNumber

public static int parse16BitNumber(byte[] input,
                                   int offset)
Method for parsing 2 bytes.

Parameters:
input - where to find the bytes
offset - where to start
Returns:
the number.

parse8BitNumber

public static int parse8BitNumber(byte[] input,
                                  int offset)
Method for parsing 1 byte.

Parameters:
input - where to find the bytes
offset - where to start
Returns:
the number.

toUnsignedInt

public static int toUnsignedInt(byte v)

toUnsignedIntegers

public static int[] toUnsignedIntegers(byte[] b)

toUnsignedLongs

public static long[] toUnsignedLongs(byte[] b)


Copyright © 2013. All Rights Reserved.