Package org.red5.io.object
Class UnsignedLong
java.lang.Object
java.lang.Number
org.red5.io.object.UnsignedNumber
org.red5.io.object.UnsignedLong
- All Implemented Interfaces:
Serializable
The UnsignedLong class wraps a value of an unsigned 64 bits number.
- Author:
- Matteo Merli (matteo.merli@gmail.com)
- See Also:
-
Field Summary
Fields inherited from class org.red5.io.object.UnsignedNumber
hexLetters -
Constructor Summary
ConstructorsConstructorDescriptionUnsignedLong(byte c) Constructor for UnsignedLong.UnsignedLong(int c) Constructor for UnsignedLong.UnsignedLong(long c) Constructor for UnsignedLong.UnsignedLong(short c) Constructor for UnsignedLong.UnsignedLong(Random random) Construct a new random UnsignedLong. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(UnsignedNumber other) compareTo.doublebooleanfloatstatic UnsignedLongfromBytes(byte[] c) fromBytes.static UnsignedLongfromBytes(byte[] c, int offset) fromBytes.static UnsignedLongfromString(String c) fromString.static UnsignedLongfromString(String c, int radix) fromString.byte[]getBytes()Get a byte array representation of the number.inthashCode()intintValue()longvoidshiftLeft(int nBits) Perform a bit left shift of the value.voidshiftRight(int nBits) Perform a bit right shift of the value.toString()Methods inherited from class org.red5.io.object.UnsignedNumber
toHexString, toHexStringMethods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
UnsignedLong
public UnsignedLong(byte c) Constructor for UnsignedLong.
- Parameters:
c- a byte
-
UnsignedLong
public UnsignedLong(short c) Constructor for UnsignedLong.
- Parameters:
c- a short
-
UnsignedLong
public UnsignedLong(int c) Constructor for UnsignedLong.
- Parameters:
c- a int
-
UnsignedLong
public UnsignedLong(long c) Constructor for UnsignedLong.
- Parameters:
c- a long
-
UnsignedLong
Construct a new random UnsignedLong.- Parameters:
random- a Random handler
-
-
Method Details
-
fromBytes
fromBytes.
- Parameters:
c- an array ofobjectsinvalid reference
byte- Returns:
- a
UnsignedLongobject
-
fromBytes
fromBytes.
- Parameters:
c- an array ofobjectsinvalid reference
byteoffset- a int- Returns:
- a
UnsignedLongobject
-
fromString
fromString.
- Parameters:
c- aStringobject- Returns:
- a
UnsignedLongobject
-
fromString
fromString.
- Parameters:
c- aStringobjectradix- a int- Returns:
- a
UnsignedLongobject
-
getBytes
public byte[] getBytes()Get a byte array representation of the number. The order will be MSB first (Big Endian).- Specified by:
getBytesin classUnsignedNumber- Returns:
- the serialized number
-
toString
- Specified by:
toStringin classUnsignedNumber
-
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
compareTo
compareTo.
- Specified by:
compareToin classUnsignedNumber- Parameters:
other- aUnsignedNumberobject- Returns:
- a int
-
equals
- Specified by:
equalsin classUnsignedNumber
-
hashCode
public int hashCode()- Specified by:
hashCodein classUnsignedNumber
-
shiftRight
public void shiftRight(int nBits) Perform a bit right shift of the value.- Specified by:
shiftRightin classUnsignedNumber- Parameters:
nBits- the number of positions to shift
-
shiftLeft
public void shiftLeft(int nBits) Perform a bit left shift of the value.- Specified by:
shiftLeftin classUnsignedNumber- Parameters:
nBits- the number of positions to shift
-