|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--javar.util.NumberUtil
This will help in converting numbers
| Constructor Summary | |
NumberUtil()
|
|
| Method Summary | |
static long |
toSigned(byte value)
This method will convert the byte to an signed value |
static long |
toSigned(byte left,
byte right)
This method will convert the two byte to an unsigned value |
static long |
toSigned(byte one,
byte two,
byte three,
byte four)
This method will convert the two byte to an unsigned value |
static byte[] |
toSignedByteBytes(long value)
This will take a signed byte value and convert it to a byte array with one byte. |
static byte[] |
toSignedIntegerBytes(long value)
This will take a signed int value and convert it to a byte array with four bytes. |
static byte[] |
toSignedShortBytes(long value)
This will take a signed short value and convert it to a byte array with two bytes. |
static long |
toUnsigned(byte value)
This method will convert the byte to an unsigned value |
static long |
toUnsigned(byte left,
byte right)
This method will convert the two byte to an unsigned value |
static byte[] |
toUnsignedByteBytes(long value)
This will take an unsigned byte value and convert it to a byte array with one byte |
static byte[] |
toUnsignedIntegerBytes(long value)
This will take a signed int value and convert it to a byte array with four bytes. |
static byte[] |
toUnsignedShortBytes(long value)
This will take an unsigned short value and convert it to a byte array with two bytes |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public NumberUtil()
| Method Detail |
public static final long toUnsigned(byte value)
value - The most significant bytes
public static final long toSigned(byte value)
value - The most significant bytes
public static final long toUnsigned(byte left,
byte right)
left - The most significant bytesright - The least significant bytes
public static final long toSigned(byte left,
byte right)
left - The most significant bytesright - The least significant bytes
public static final long toSigned(byte one,
byte two,
byte three,
byte four)
public static final byte[] toUnsignedByteBytes(long value)
value - an unsigned byte value
public static final byte[] toSignedByteBytes(long value)
value - an signed byte value
public static final byte[] toUnsignedShortBytes(long value)
value - an unsigned short value
public static final byte[] toSignedShortBytes(long value)
value - an signed short value
public static final byte[] toSignedIntegerBytes(long value)
value - an signed int value
public static final byte[] toUnsignedIntegerBytes(long value)
value - an signed int value
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||