Package org.red5.io.object
Class UnsignedInt
java.lang.Object
java.lang.Number
org.red5.io.object.UnsignedNumber
org.red5.io.object.UnsignedInt
- All Implemented Interfaces:
Serializable
The UnsignedInt class wraps a value of an unsigned 32 bits number.
- Author:
- Matteo Merli ([email protected])
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final longprivate longFields inherited from class org.red5.io.object.UnsignedNumber
hexLetters -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUnsignedInt(byte c) UnsignedInt(int c) UnsignedInt(long c) UnsignedInt(short c) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(UnsignedNumber other) doublebooleanfloatstatic UnsignedIntfromBytes(byte[] c) static UnsignedIntfromBytes(byte[] c, int idx) static UnsignedIntfromString(String c) static UnsignedIntfromString(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
static final long serialVersionUID- See Also:
-
value
private long value
-
-
Constructor Details
-
UnsignedInt
public UnsignedInt(byte c) -
UnsignedInt
public UnsignedInt(short c) -
UnsignedInt
public UnsignedInt(int c) -
UnsignedInt
public UnsignedInt(long c) -
UnsignedInt
private UnsignedInt()
-
-
Method Details
-
fromBytes
-
fromBytes
-
fromString
-
fromString
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
intValue
public int intValue() -
longValue
public long longValue() -
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
-
compareTo
- Specified by:
compareToin classUnsignedNumber
-
equals
- Specified by:
equalsin classUnsignedNumber
-
toString
- Specified by:
toStringin 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
-