All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class fi.faidon.util.ByteArrayConversion

java.lang.Object
   |
   +----fi.faidon.util.ByteArrayConversion

public class ByteArrayConversion
extends Object
Class that provides utilities for converting various data types to and from byte-array presentation.


Constructor Index

 o ByteArrayConversion()

Method Index

 o bytesLEasINT(byte[], int, int)
Return the int value given by the byte array in little-endian order.
 o bytesLEasUINT(byte[], int, int)
Return the unsigned int value given by the byte array in little-endian (?) order.
 o intAsBytesLE(int, byte[], int, int)
Return the int value given by the byte array in little-endian order.
 o uintAsBytesBE(int, byte[], int, int)
Convert the int value into a byte array that starts from index "startOff" and end at index "endOff" - 1 of "buf".
 o uintAsBytesLE(int, byte[], int, int)
Convert the int value into a little-endian byte array that starts from index "startOff" and end at index "endOff" - 1 of "buf".
 o ulongAsBytesBE(long, byte[], int, int)
Convert the long value into a byte array that starts from index "startOff" and end at index "endOff" - 1 of "buf".

Constructors

 o ByteArrayConversion
 public ByteArrayConversion()

Methods

 o bytesLEasUINT
 public static int bytesLEasUINT(byte bytes[],
                                 int start_offset,
                                 int end_offset)
Return the unsigned int value given by the byte array in little-endian (?) order.

 o bytesLEasINT
 public static int bytesLEasINT(byte bytes[],
                                int start_offset,
                                int end_offset)
Return the int value given by the byte array in little-endian order. Here we interpret the first bit of the first byte as being a sign bit.

 o ulongAsBytesBE
 public static void ulongAsBytesBE(long value,
                                   byte bytes[],
                                   int startOff,
                                   int endOff)
Convert the long value into a byte array that starts from index "startOff" and end at index "endOff" - 1 of "buf". Bytes are in big-endian order.

 o uintAsBytesBE
 public static void uintAsBytesBE(int value,
                                  byte bytes[],
                                  int startOff,
                                  int endOff)
Convert the int value into a byte array that starts from index "startOff" and end at index "endOff" - 1 of "buf". Bytes are in big-endian order.

 o uintAsBytesLE
 public static void uintAsBytesLE(int value,
                                  byte bytes[],
                                  int startOff,
                                  int endOff)
Convert the int value into a little-endian byte array that starts from index "startOff" and end at index "endOff" - 1 of "buf".

 o intAsBytesLE
 public static void intAsBytesLE(int value,
                                 byte bytes[],
                                 int startOffset,
                                 int endOffset)
Return the int value given by the byte array in little-endian order. Here we interpret the first bit of the first byte as being a sign bit.


All Packages  Class Hierarchy  This Package  Previous  Next  Index