lejos.util
Class EndianTools

java.lang.Object
  extended by lejos.util.EndianTools

public class EndianTools
extends java.lang.Object

Tools for manipulating numbers in little-endian and big-endian encodings


Constructor Summary
EndianTools()
           
 
Method Summary
static int decodeIntBE(byte[] b, int off)
           
static int decodeIntLE(byte[] b, int off)
           
static long decodeLongBE(byte[] b, int off)
           
static long decodeLongLE(byte[] b, int off)
           
static short decodeShortBE(byte[] b, int off)
           
static short decodeShortLE(byte[] b, int off)
           
static long decodeUIntBE(byte[] b, int off)
           
static long decodeUIntLE(byte[] b, int off)
           
static int decodeUShortBE(byte[] b, int off)
           
static int decodeUShortLE(byte[] b, int off)
           
static void encodeIntBE(int v, byte[] b, int off)
           
static void encodeIntLE(int v, byte[] b, int off)
           
static void encodeLongBE(long v, byte[] b, int off)
           
static void encodeLongLE(long v, byte[] b, int off)
           
static void encodeShortBE(int v, byte[] b, int off)
           
static void encodeShortLE(int v, byte[] b, int off)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndianTools

public EndianTools()
Method Detail

decodeLongBE

public static long decodeLongBE(byte[] b,
                                int off)

decodeUIntBE

public static long decodeUIntBE(byte[] b,
                                int off)

decodeUShortBE

public static int decodeUShortBE(byte[] b,
                                 int off)

decodeIntBE

public static int decodeIntBE(byte[] b,
                              int off)

decodeShortBE

public static short decodeShortBE(byte[] b,
                                  int off)

decodeLongLE

public static long decodeLongLE(byte[] b,
                                int off)

decodeUIntLE

public static long decodeUIntLE(byte[] b,
                                int off)

decodeUShortLE

public static int decodeUShortLE(byte[] b,
                                 int off)

decodeIntLE

public static int decodeIntLE(byte[] b,
                              int off)

decodeShortLE

public static short decodeShortLE(byte[] b,
                                  int off)

encodeLongBE

public static void encodeLongBE(long v,
                                byte[] b,
                                int off)

encodeIntBE

public static void encodeIntBE(int v,
                               byte[] b,
                               int off)

encodeShortBE

public static void encodeShortBE(int v,
                                 byte[] b,
                                 int off)

encodeLongLE

public static void encodeLongLE(long v,
                                byte[] b,
                                int off)

encodeIntLE

public static void encodeIntLE(int v,
                               byte[] b,
                               int off)

encodeShortLE

public static void encodeShortLE(int v,
                                 byte[] b,
                                 int off)