Enum MagicBytes

    • Enum Constant Detail

      • ACKNOWLEDGE

        public static final MagicBytes ACKNOWLEDGE
        Magic bytes identifying a transmission acknowledge, same as Ascii.ACK.
      • CLEAR_TO_SEND

        public static final MagicBytes CLEAR_TO_SEND
        Magic bytes identifying a Clear-to-Send transmission, same as Ascii.ACK.
      • LAST_PACKET

        public static final MagicBytes LAST_PACKET
        Magic bytes identifying a last transmission package, same as Ascii.ETX.
      • PACKET

        public static final MagicBytes PACKET
        Magic bytes identifying an transmission package, same as Ascii.STX.
      • READY_TO_RECEIVE

        public static final MagicBytes READY_TO_RECEIVE
        Magic bytes identifying a Ready-to-Receive transmission, same as Ascii.ENQ.
      • READY_TO_SEND

        public static final MagicBytes READY_TO_SEND
        Magic bytes identifying a Ready-to-Send transmission, same as Ascii.ENQ.
    • Method Detail

      • values

        public static MagicBytes[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MagicBytes c : MagicBytes.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MagicBytes valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getMagicBytes

        public byte[] getMagicBytes()
        Specified by:
        getMagicBytes in interface org.refcodes.mixin.MagicBytesAccessor
      • toMagicBytes

        public static byte[] toMagicBytes​(MagicBytes... aMagicBytes)
        Constructs magic bytes from the provided MagicBytes elements to be concatenated to a single magic bytes sequence.
        Parameters:
        aMagicBytes - The MagicBytes elements from which to create the magic bytes.
        Returns:
        The accordingly created magic bytes.