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
public final class UnsignedShort extends UnsignedNumber
The UnsignedByte class wraps a value of an unsigned 16 bits number.- Author:
- Matteo Merli (matteo.merli@gmail.com)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.red5.io.object.UnsignedNumber
hexLetters
-
-
Constructor Summary
Constructors Constructor Description UnsignedShort(byte c)UnsignedShort(int c)UnsignedShort(long c)UnsignedShort(short c)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(UnsignedNumber other)doubledoubleValue()booleanequals(Object other)floatfloatValue()static UnsignedShortfromBytes(byte[] c)static UnsignedShortfromBytes(byte[] c, int idx)static UnsignedShortfromString(String c)static UnsignedShortfromString(String c, int radix)byte[]getBytes()Get a byte array representation of the number.inthashCode()intintValue()longlongValue()voidshiftLeft(int nBits)Perform a bit left shift of the value.voidshiftRight(int nBits)Perform a bit right shift of the value.shortshortValue()StringtoString()-
Methods inherited from class org.red5.io.object.UnsignedNumber
toHexString, toHexString
-
-
-
-
Method Detail
-
fromBytes
public static UnsignedShort fromBytes(byte[] c)
-
fromBytes
public static UnsignedShort fromBytes(byte[] c, int idx)
-
fromString
public static UnsignedShort fromString(String c)
-
fromString
public static UnsignedShort fromString(String c, int radix)
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein classNumber
-
floatValue
public float floatValue()
- Specified by:
floatValuein classNumber
-
shortValue
public short shortValue()
- Overrides:
shortValuein classNumber
-
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
public int compareTo(UnsignedNumber other)
- Specified by:
compareToin classUnsignedNumber
-
equals
public boolean equals(Object other)
- Specified by:
equalsin classUnsignedNumber
-
hashCode
public int hashCode()
- Specified by:
hashCodein classUnsignedNumber
-
toString
public String toString()
- Specified by:
toStringin 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
-
-