Package org.red5.io.object
Class UnsignedNumber
java.lang.Object
java.lang.Number
org.red5.io.object.UnsignedNumber
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
UnsignedByte,UnsignedInt,UnsignedLong,UnsignedShort
- Author:
- Matteo Merli ([email protected])
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final char[]private static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intcompareTo(UnsignedNumber other) abstract booleanabstract byte[]getBytes()Get a byte array representation of the number.abstract inthashCode()abstract voidshiftLeft(int nBits) Perform a bit left shift of the value.abstract voidshiftRight(int nBits) Perform a bit right shift of the value.toHexString(boolean pad) abstract StringtoString()Methods inherited from class java.lang.Number
byteValue, doubleValue, floatValue, intValue, longValue, shortValue
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
hexLetters
protected static final char[] hexLetters
-
-
Constructor Details
-
UnsignedNumber
public UnsignedNumber()
-
-
Method Details
-
getBytes
public abstract byte[] getBytes()Get a byte array representation of the number. The order will be MSB first (Big Endian).- Returns:
- the serialized number
-
shiftRight
public abstract void shiftRight(int nBits) Perform a bit right shift of the value.- Parameters:
nBits- the number of positions to shift
-
shiftLeft
public abstract void shiftLeft(int nBits) Perform a bit left shift of the value.- Parameters:
nBits- the number of positions to shift
-
toString
-
compareTo
-
equals
-
hashCode
public abstract int hashCode() -
toHexString
-
toHexString
-