Package org.eolang

Class BytesOf

  • All Implemented Interfaces:
    Bytes, Data<byte[]>

    public final class BytesOf
    extends Object
    implements Bytes
    Bytes.
    Since:
    1.0
    • Constructor Detail

      • BytesOf

        public BytesOf​(byte[] data)
        Ctor.
        Parameters:
        data - Data.
      • BytesOf

        public BytesOf​(String str)
        Ctor.
        Parameters:
        str - UTF-8 Text.
      • BytesOf

        public BytesOf​(long number)
        Ctor.
        Parameters:
        number - Long number.
      • BytesOf

        public BytesOf​(Double number)
        Ctor.
        Parameters:
        number - Double number.
    • Method Detail

      • not

        public Bytes not()
        Description copied from interface: Bytes
        NOT operation.
        Specified by:
        not in interface Bytes
        Returns:
        Bytes.
      • and

        public Bytes and​(Bytes other)
        Description copied from interface: Bytes
        AND operation.
        Specified by:
        and in interface Bytes
        Parameters:
        other - Bytes.
        Returns:
        Bytes.
      • or

        public Bytes or​(Bytes other)
        Description copied from interface: Bytes
        OR operation.
        Specified by:
        or in interface Bytes
        Parameters:
        other - Bytes.
        Returns:
        Bytes.
      • xor

        public Bytes xor​(Bytes other)
        Description copied from interface: Bytes
        XOR operation.
        Specified by:
        xor in interface Bytes
        Parameters:
        other - Bytes.
        Returns:
        Bytes.
      • shift

        public Bytes shift​(int bits)
        Description copied from interface: Bytes
        Big-endian shift.
        Specified by:
        shift in interface Bytes
        Parameters:
        bits - Bits to shift, negative to shift left.
        Returns:
        Bytes.
      • asNumber

        public <T extends Number> T asNumber​(Class<T> type)
        Description copied from interface: Bytes
        Convert to number.
        Specified by:
        asNumber in interface Bytes
        Type Parameters:
        T - Numeric type.
        Parameters:
        type - Type.
        Returns:
        Number.
      • take

        public byte[] take()
        Description copied from interface: Data
        Take the data.
        Specified by:
        take in interface Data<byte[]>
        Returns:
        The data
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object