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
public abstract class UnsignedNumber extends Number
- Author:
- Matteo Merli (matteo.merli@gmail.com)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static char[]hexLetters
-
Constructor Summary
Constructors Constructor Description UnsignedNumber()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract intcompareTo(UnsignedNumber other)abstract booleanequals(Object other)abstract 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.StringtoHexString()StringtoHexString(boolean pad)abstract StringtoString()-
Methods inherited from class java.lang.Number
byteValue, doubleValue, floatValue, intValue, longValue, shortValue
-
-
-
-
Method Detail
-
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
-
compareTo
public abstract int compareTo(UnsignedNumber other)
-
toHexString
public String toHexString()
-
toHexString
public String toHexString(boolean pad)
-
-