Package org.red5.io.object
Class UnsignedByte
java.lang.Object
java.lang.Number
org.red5.io.object.UnsignedNumber
org.red5.io.object.UnsignedByte
- All Implemented Interfaces:
Serializable
The UnsignedByte class wraps a value of and unsigned 8 bits number.
- Author:
- Matteo Merli ([email protected])
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final longprivate shortFields inherited from class org.red5.io.object.UnsignedNumber
hexLetters -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUnsignedByte(byte c) UnsignedByte(int c) UnsignedByte(long c) UnsignedByte(short c) -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(UnsignedNumber other) doublebooleanfloatstatic UnsignedBytefromBytes(byte[] c) static UnsignedBytefromBytes(byte[] c, int idx) static UnsignedBytefromString(String c) static UnsignedBytefromString(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.shorttoString()Methods inherited from class org.red5.io.object.UnsignedNumber
toHexString, toHexString
-
Field Details
-
serialVersionUID
static final long serialVersionUID- See Also:
-
value
private short value
-
-
Constructor Details
-
UnsignedByte
public UnsignedByte(byte c) -
UnsignedByte
public UnsignedByte(short c) -
UnsignedByte
public UnsignedByte(int c) -
UnsignedByte
public UnsignedByte(long c) -
UnsignedByte
private UnsignedByte()
-
-
Method Details
-
fromBytes
-
fromBytes
-
fromString
-
fromString
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
shortValue
public short shortValue()- Overrides:
shortValuein 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
-
hashCode
public int hashCode()- Specified by:
hashCodein classUnsignedNumber
-
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
-