net.sf.briar.util
Class ByteUtils

java.lang.Object
  extended by net.sf.briar.util.ByteUtils

public class ByteUtils
extends java.lang.Object


Field Summary
static int MAX_16_BIT_UNSIGNED
          The maximum value that can be represented as an unsigned 16-bit integer.
static long MAX_32_BIT_UNSIGNED
          The maximum value that can be represented as an unsigned 32-bit integer.
 
Constructor Summary
ByteUtils()
           
 
Method Summary
static int readUint16(byte[] b, int offset)
           
static long readUint32(byte[] b, int offset)
           
static void writeUint16(int i, byte[] b, int offset)
           
static void writeUint32(long i, byte[] b, int offset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_16_BIT_UNSIGNED

public static final int MAX_16_BIT_UNSIGNED
The maximum value that can be represented as an unsigned 16-bit integer.

See Also:
Constant Field Values

MAX_32_BIT_UNSIGNED

public static final long MAX_32_BIT_UNSIGNED
The maximum value that can be represented as an unsigned 32-bit integer.

See Also:
Constant Field Values
Constructor Detail

ByteUtils

public ByteUtils()
Method Detail

writeUint16

public static void writeUint16(int i,
                               byte[] b,
                               int offset)

writeUint32

public static void writeUint32(long i,
                               byte[] b,
                               int offset)

readUint16

public static int readUint16(byte[] b,
                             int offset)

readUint32

public static long readUint32(byte[] b,
                              int offset)