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 ([email protected])
- See Also:
-
Field Summary
FieldsFields inherited from class org.red5.io.object.UnsignedNumber
hexLetters -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUnsignedLong(byte c) UnsignedLong(int c) UnsignedLong(long c) UnsignedLong(short c) UnsignedLong(Random random) Construct a new random UnsignedLong. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(UnsignedNumber other) doublebooleanfloatstatic UnsignedLongfromBytes(byte[] c) static UnsignedLongfromBytes(byte[] c, int offset) static UnsignedLongfromString(String c) static UnsignedLongfromString(String c, int radix) 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
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
value
private byte[] value
-
-
Constructor Details
-
UnsignedLong
public UnsignedLong(byte c) -
UnsignedLong
public UnsignedLong(short c) -
UnsignedLong
public UnsignedLong(int c) -
UnsignedLong
public UnsignedLong(long c) -
UnsignedLong
Construct a new random UnsignedLong.- Parameters:
random- a Random handler
-
UnsignedLong
private UnsignedLong()
-
-
Method Details
-
fromBytes
-
fromBytes
-
fromString
-
fromString
-
getBytes
public byte[] getBytes()Description copied from class:UnsignedNumberGet 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
- Specified by:
compareToin classUnsignedNumber
-
equals
- Specified by:
equalsin classUnsignedNumber
-
hashCode
public int hashCode()- Specified by:
hashCodein classUnsignedNumber
-
shiftRight
public void shiftRight(int nBits) Description copied from class:UnsignedNumberPerform 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) Description copied from class:UnsignedNumberPerform a bit left shift of the value.- Specified by:
shiftLeftin classUnsignedNumber- Parameters:
nBits- the number of positions to shift
-