Package org.eolang

Interface Bytes

  • All Superinterfaces:
    Data<byte[]>
    All Known Implementing Classes:
    BytesOf

    public interface Bytes
    extends Data<byte[]>
    Bytes. Represents byte array of arbitrary size, convertible to a numeric value. Original size is preserved by and, or and xor.
    Since:
    1.0
    • Method Detail

      • not

        Bytes not()
        NOT operation.
        Returns:
        Bytes.
      • and

        Bytes and​(Bytes other)
        AND operation.
        Parameters:
        other - Bytes.
        Returns:
        Bytes.
      • or

        Bytes or​(Bytes other)
        OR operation.
        Parameters:
        other - Bytes.
        Returns:
        Bytes.
      • xor

        Bytes xor​(Bytes other)
        XOR operation.
        Parameters:
        other - Bytes.
        Returns:
        Bytes.
      • shift

        Bytes shift​(int bits)
        Big-endian unsigned shift. Shifts left if value is positive, or right otherwise. Does not perform sign extension.
        Parameters:
        bits - Bits to shift, negative to shift left.
        Returns:
        Bytes.
      • sshift

        Bytes sshift​(int bits)
        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.
        Parameters:
        bits - Bits to shift, negative value causes exception.
        Returns:
        Bytes.
      • asNumber

        <T extends Number> T asNumber​(Class<T> type)
        Convert to number.
        Type Parameters:
        T - Numeric type.
        Parameters:
        type - Type.
        Returns:
        Number.
      • toPhi

        static Phi toPhi​(Bytes bytes)
        Convert Bytes to Phi.
        Parameters:
        bytes - Bytes.
        Returns:
        Phi object.