Package org.eolang
Class BytesOf
- java.lang.Object
-
- org.eolang.BytesOf
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bytes
and(Bytes other)
AND operation.Double
asNumber()
Convert to double number.<T extends Number>
TasNumber(Class<T> type)
Convert to number.String
asString()
Convert to string.boolean
equals(Object other)
int
hashCode()
Bytes
not()
NOT operation.Bytes
or(Bytes other)
OR operation.Bytes
shift(int bits)
Big-endian unsigned shift.Bytes
sshift(int bits)
Big-endian signed right shift.byte[]
take()
Get bytes itself.String
toString()
Bytes
xor(Bytes other)
XOR operation.
-
-
-
Constructor Detail
-
BytesOf
public BytesOf(Bytes bytes)
Ctor.- Parameters:
bytes
- Bytes.
-
BytesOf
public BytesOf(byte[] data)
Ctor.- Parameters:
data
- Data.
-
BytesOf
public BytesOf(String str)
Ctor.- Parameters:
str
- UTF-8 Text.
-
BytesOf
public BytesOf(int number)
Ctor.- Parameters:
number
- Integer number.
-
BytesOf
public BytesOf(char chr)
Ctor.- Parameters:
chr
- Character.
-
BytesOf
public BytesOf(long number)
Ctor.- Parameters:
number
- Long number.
-
BytesOf
public BytesOf(double number)
Ctor.- Parameters:
number
- Double number.
-
-
Method Detail
-
shift
public Bytes shift(int bits)
Description copied from interface:Bytes
Big-endian unsigned shift. Shifts left if value is positive, or right otherwise. Does not perform sign extension.
-
sshift
public Bytes sshift(int bits)
Description copied from interface:Bytes
Big-endian signed right shift. Performs sign extension, i.e. it will fill the top bits with 1 if the first bit is 1 and with 0 otherwise.
-
asNumber
public Double asNumber()
Description copied from interface:Bytes
Convert to double number.
-
asNumber
public <T extends Number> T asNumber(Class<T> type)
Description copied from interface:Bytes
Convert to number.
-
take
public byte[] take()
Description copied from interface:Bytes
Get bytes itself.
-
-