iRex DR1000 Merger v0.4.1

it.andynaz.irex.dr1000.scribble
Class Util

java.lang.Object
  extended by it.andynaz.irex.dr1000.scribble.Util

public class Util
extends Object

Usefull methods for threating with the scribble blobs.

Version:
2013-08-01
Author:
andynaz

Constructor Summary
Util()
           
 
Method Summary
static float get4ByteFloat(int i1, int i2, int i3, int i4)
          Transform 4 bytes in a float.
static int getIntFromBytes(int... x)
          Transform a series of bytes in an int.
static void skip(List l, int n)
          Remove the first n elements from a list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

getIntFromBytes

public static int getIntFromBytes(int... x)
Transform a series of bytes in an int. The bytes are treated in inverse order, like "... i3 i2 i1", considering the bits of each one. Each int must represent a byte, so its value must be included in the range [0, 255].

Parameters:
x - ints representing bytes
Returns:
the int correspong to the bytes' bits
Throws:
IllegalArgumentException - if at least one of the ints does not represent a byte, ie its value does not belong to the range [0, 255]

get4ByteFloat

public static float get4ByteFloat(int i1,
                                  int i2,
                                  int i3,
                                  int i4)
Transform 4 bytes in a float. The 4 bytes are treated in inverse order, like "i4 i3 i2 i1", considering the bits of each one. Each int must represent a byte, so its value must be included in the range [0, 255].

The 32 bits are converted according to the IEEE 754 floating-point "single format" bit layout, using the Float.intBitsToFloat(int) method.

Parameters:
i1 - valore compreso nell'intervallo [0,255]
i2 - valore compreso nell'intervallo [0,255]
i3 - valore compreso nell'intervallo [0,255]
i4 - valore compreso nell'intervallo [0,255]
Returns:
il valore del float corrispondente alla sequenza di bit dei 4 byte

skip

public static void skip(List l,
                        int n)
Remove the first n elements from a list.

Parameters:
l - collection from whom remove the elements
n - number of elements to remove

iRex DR1000 Merger v0.4.1

© 2013 andynaz - http://andynaz.altervista.org