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 TypeMethodDescriptionint
compareTo
(UnsignedNumber other) compareTo.double
boolean
float
static UnsignedLong
fromBytes
(byte[] c) fromBytes.static UnsignedLong
fromBytes
(byte[] c, int offset) fromBytes.static UnsignedLong
fromString
(String c) fromString.static UnsignedLong
fromString
(String c, int radix) fromString.byte[]
getBytes()
Get a byte array representation of the number.int
hashCode()
int
intValue()
long
void
shiftLeft
(int nBits) Perform a bit left shift of the value.void
shiftRight
(int nBits) Perform a bit right shift of the value.toString()
Methods inherited from class org.red5.io.object.UnsignedNumber
toHexString, toHexString
Methods 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 ofinvalid reference
byte
- Returns:
- a
UnsignedLong
object
-
fromBytes
fromBytes.
- Parameters:
c
- an array ofinvalid reference
byte
offset
- a int- Returns:
- a
UnsignedLong
object
-
fromString
fromString.
- Parameters:
c
- aString
object- Returns:
- a
UnsignedLong
object
-
fromString
fromString.
- Parameters:
c
- aString
objectradix
- a int- Returns:
- a
UnsignedLong
object
-
getBytes
public byte[] getBytes()Get a byte array representation of the number. The order will be MSB first (Big Endian).- Specified by:
getBytes
in classUnsignedNumber
- Returns:
- the serialized number
-
toString
- Specified by:
toString
in classUnsignedNumber
-
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- Specified by:
floatValue
in classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in classNumber
-
compareTo
compareTo.
- Specified by:
compareTo
in classUnsignedNumber
- Parameters:
other
- aUnsignedNumber
object- Returns:
- a int
-
equals
- Specified by:
equals
in classUnsignedNumber
-
hashCode
public int hashCode()- Specified by:
hashCode
in classUnsignedNumber
-
shiftRight
public void shiftRight(int nBits) Perform a bit right shift of the value.- Specified by:
shiftRight
in 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:
shiftLeft
in classUnsignedNumber
- Parameters:
nBits
- the number of positions to shift
-