Package org.red5.io.object
Class UnsignedShort
java.lang.Object
java.lang.Number
org.red5.io.object.UnsignedNumber
org.red5.io.object.UnsignedShort
- All Implemented Interfaces:
Serializable
The UnsignedByte class wraps a value of an unsigned 16 bits number.
- Author:
- Matteo Merli (matteo.merli@gmail.com)
- See Also:
-
Field Summary
Modifier and TypeFieldDescription(package private) static final long
private int
Fields inherited from class org.red5.io.object.UnsignedNumber
hexLetters
-
Constructor Summary
ModifierConstructorDescriptionprivate
UnsignedShort
(byte c) UnsignedShort
(int c) UnsignedShort
(long c) UnsignedShort
(short c) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(UnsignedNumber other) double
boolean
float
static UnsignedShort
fromBytes
(byte[] c) static UnsignedShort
fromBytes
(byte[] c, int idx) static UnsignedShort
fromString
(String c) static UnsignedShort
fromString
(String c, int radix) 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.short
toString()
Methods inherited from class org.red5.io.object.UnsignedNumber
toHexString, toHexString
-
Field Details
-
serialVersionUID
static final long serialVersionUID- See Also:
-
value
private int value
-
-
Constructor Details
-
UnsignedShort
public UnsignedShort(byte c) -
UnsignedShort
public UnsignedShort(short c) -
UnsignedShort
public UnsignedShort(int c) -
UnsignedShort
public UnsignedShort(long c) -
UnsignedShort
private UnsignedShort()
-
-
Method Details
-
fromBytes
-
fromBytes
-
fromString
-
fromString
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in classNumber
-
floatValue
public float floatValue()- Specified by:
floatValue
in classNumber
-
shortValue
public short shortValue()- Overrides:
shortValue
in classNumber
-
intValue
public int intValue() -
longValue
public long longValue() -
getBytes
public byte[] getBytes()Description copied from class:UnsignedNumber
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
-
compareTo
- Specified by:
compareTo
in classUnsignedNumber
-
equals
- Specified by:
equals
in classUnsignedNumber
-
hashCode
public int hashCode()- Specified by:
hashCode
in classUnsignedNumber
-
toString
- Specified by:
toString
in classUnsignedNumber
-
shiftRight
public void shiftRight(int nBits) Description copied from class:UnsignedNumber
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) Description copied from class:UnsignedNumber
Perform a bit left shift of the value.- Specified by:
shiftLeft
in classUnsignedNumber
- Parameters:
nBits
- the number of positions to shift
-