|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectzisko.multicastor.program.model.ByteTools
public class ByteTools
Diese Klasse stellt static Methoden zur Verfuegung, um mit Byte-Arrays zu arbeiten
Constructor Summary | |
---|---|
ByteTools()
|
Method Summary | |
---|---|
static boolean |
byteToBoolean(byte[] theByte)
Wandelt das Byte-Array in ein Boolean um. |
static int |
byteToInt(byte[] theByte)
Wandelt in ein Int um. |
static long |
byteToLong(byte[] theByte)
Wandelt in ein Int um. |
static byte[] |
convertToByte(boolean theBoolean)
Wandelt in ein Byte Array um. |
static byte[] |
convertToByte(int theInteger)
Wandelt in ein Byte-Array um. |
static byte[] |
convertToByte(long theLong)
Wandelt in ein Byte-Array um. |
static byte[] |
convertToShortByte(int theInteger)
Wandelt in ein Byte-Array um. |
static byte[] |
crc16(byte[] byteArray)
Errechnet eine CRC-CCITT (CRC-16) Pruefsumme des uebergebenen byte-Arrays. |
static int |
shortByteToInt(byte[] theByte)
Wandelt in ein Int um. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ByteTools()
Method Detail |
---|
public static byte[] convertToByte(int theInteger)
theInteger
- int Wert, der in ein Byte Array umgewandelt werden soll.
public static byte[] convertToByte(long theLong)
theLong
- long Wert, der in ein Byte Array umgewandelt werden soll.
return byte[8]-Arraypublic static byte[] convertToShortByte(int theInteger)
theInteger
- Integer, der wie ein short behandelt wird (nur 2 Byte werden genutzt, negative Werte sind nicht erlaubt)
public static byte[] convertToByte(boolean theBoolean)
theBoolean
- boolean, der in ein Byte Array umgewandelt werden soll.
public static boolean byteToBoolean(byte[] theByte)
theByte
- das Byte-Array
public static byte[] crc16(byte[] byteArray)
byteArray
-
public static int shortByteToInt(byte[] theByte)
theByte
- byte[2] Array, das in ein int umgewandelt werden soll
public static int byteToInt(byte[] theByte)
theByte
- byte[4] Array, das in ein int umgewandelt werden soll
public static long byteToLong(byte[] theByte)
theByte
- byte[8] Array, das in ein int umgewandelt werden soll
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |