// Path: iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/message/IEXMessage.java
// public abstract class IEXMessage implements Serializable {
// 
//     private final IEXMessageType messageType;
// 
//     public IEXMessage(final IEXMessageType messageType) {
//         this.messageType = messageType;
//     }
// 
//     public IEXMessageType getMessageType() {
//         return messageType;
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         final IEXMessage that = (IEXMessage) o;
//         return messageType == that.messageType;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(messageType);
//     }
// 
//     @Override
//     public String toString() {
//         return "IEXMessage{" +
//                 "messageType=" + messageType +
//                 '}';
//     }
// }
// 
// Path: iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/message/administrative/field/IEXOperationalHaltStatus.java
// public enum IEXOperationalHaltStatus implements IEXByteEnum {
// 
//     OPERATIONAL_TRADING_HALt((byte) 0x4f),
//     NOT_OPERATIONAL_HALTED((byte) 0x4e);
// 
//     private static final Map<Byte, IEXOperationalHaltStatus> LOOKUP = new HashMap<>();
// 
//     static {
//         for (final IEXOperationalHaltStatus value : EnumSet.allOf(IEXOperationalHaltStatus.class))
//             LOOKUP.put(value.getCode(), value);
//     }
// 
//     private final byte code;
// 
//     IEXOperationalHaltStatus(final byte code) {
//         this.code = code;
//     }
// 
//     public static IEXOperationalHaltStatus getOperationalHaltStatus(final byte code) {
//         return lookup(IEXOperationalHaltStatus.class, LOOKUP, code);
//     }
// 
//     @Override
//     public byte getCode() {
//         return code;
//     }
// }
// 
// Path: iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/util/IEXByteConverter.java
// public class IEXByteConverter {
// 
//     private IEXByteConverter() {
//     }
// 
//     public static long convertBytesToLong(final byte[] bytes) {
//         return (long) (0xff & bytes[7]) << 56 |
//                 (long) (0xff & bytes[6]) << 48 |
//                 (long) (0xff & bytes[5]) << 40 |
//                 (long) (0xff & bytes[4]) << 32 |
//                 (long) (0xff & bytes[3]) << 24 |
//                 (long) (0xff & bytes[2]) << 16 |
//                 (long) (0xff & bytes[1]) << 8 |
//                 (long) (0xff & bytes[0]) << 0;
//     }
// 
//     public static int convertBytesToInt(final byte[] bytes) {
//         return ((0xff & bytes[3]) << 24 |
//                 (0xff & bytes[2]) << 16 |
//                 (0xff & bytes[1]) << 8 |
//                 (0xff & bytes[0]) << 0
//         );
//     }
// 
//     public static byte[] toByteArray(int value) {
//         return new byte[]{
//                 (byte) value,
//                 (byte) (value >> 8 & 0xFF),
//                 (byte) (value >> 16 & 0xFF),
//                 (byte) (value >> 24 & 0xFF)};
//     }
// 
//     public static int convertBytesToUnsignedShort(final byte[] bytes) {
//         return convertBytesToShort(bytes) & 0xffff;
//     }
// 
//     public static short convertBytesToShort(final byte[] bytes) {
//         return (short) (
//                 (0xff & bytes[1]) << 8 |
//                         (0xff & bytes[0]) << 0);
//     }
// 
//     public static String convertBytesToString(final byte[] bytes) {
//         return new String(bytes).trim();
//     }
// 
//     public static IEXPrice convertBytesToIEXPrice(final byte[] bytes) {
//         return new IEXPrice(convertBytesToLong(bytes));
//     }
// 
//     public static byte[] convertToRightPaddedString(final String value, final int size) {
//         byte[] outputArray = new byte[size];
//         Arrays.fill(outputArray, (byte) ' ');
//         final byte[] valueArray = value.getBytes(StandardCharsets.UTF_8);
//         if (valueArray.length > outputArray.length) {
//             throw new ArrayIndexOutOfBoundsException();
//         }
//         System.arraycopy(valueArray, 0, outputArray, 0, valueArray.length);
//         return outputArray;
//     }
// }


import pl.zankowski.iextrading4j.hist.api.message.IEXMessage;
import pl.zankowski.iextrading4j.hist.api.message.administrative.field.IEXOperationalHaltStatus;
import pl.zankowski.iextrading4j.hist.api.util.IEXByteConverter;
import java.util.Arrays;
import java.util.Objects;
import static pl.zankowski.iextrading4j.hist.api.IEXMessageType.OPERATIONAL_HALT_STATUS;
package pl.zankowski.iextrading4j.hist.api.message.administrative;




public class IEXOperationalHaltStatusMessage extends IEXMessage {

    public static final int LENGTH = 18;

    private final IEXOperationalHaltStatus operationalHaltStatus;
    private final long timestamp;
    private final String symbol;

    private IEXOperationalHaltStatusMessage(
            final IEXOperationalHaltStatus operationalHaltStatus,
            final long timestamp,
            final String symbol) {
        super(OPERATIONAL_HALT_STATUS);
        this.operationalHaltStatus = operationalHaltStatus;
        this.timestamp = timestamp;
        this.symbol = symbol;
    }

    public static IEXOperationalHaltStatusMessage createIEXMessage(final byte[] bytes) {
        final IEXOperationalHaltStatus operationalHaltStatus = IEXOperationalHaltStatus.getOperationalHaltStatus(bytes[1]);
        final long timestamp = IEXByteConverter.convertBytesToLong(Arrays.copyOfRange(bytes, 2, 10));
        final String symbol = IEXByteConverter.convertBytesToString(Arrays.copyOfRange(bytes, 10, 18));

        return new IEXOperationalHaltStatusMessage(operationalHaltStatus, timestamp, symbol);
    }

    public IEXOperationalHaltStatus getOperationalHaltStatus() {
// Path: iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/message/IEXMessage.java
// public abstract class IEXMessage implements Serializable {
// 
//     private final IEXMessageType messageType;
// 
//     public IEXMessage(final IEXMessageType messageType) {
//         this.messageType = messageType;
//     }
// 
//     public IEXMessageType getMessageType() {
//         return messageType;
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
//         final IEXMessage that = (IEXMessage) o;
//         return messageType == that.messageType;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(messageType);
//     }
// 
//     @Override
//     public String toString() {
//         return "IEXMessage{" +
//                 "messageType=" + messageType +
//                 '}';
//     }
// }
// 
// Path: iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/message/administrative/field/IEXOperationalHaltStatus.java
// public enum IEXOperationalHaltStatus implements IEXByteEnum {
// 
//     OPERATIONAL_TRADING_HALt((byte) 0x4f),
//     NOT_OPERATIONAL_HALTED((byte) 0x4e);
// 
//     private static final Map<Byte, IEXOperationalHaltStatus> LOOKUP = new HashMap<>();
// 
//     static {
//         for (final IEXOperationalHaltStatus value : EnumSet.allOf(IEXOperationalHaltStatus.class))
//             LOOKUP.put(value.getCode(), value);
//     }
// 
//     private final byte code;
// 
//     IEXOperationalHaltStatus(final byte code) {
//         this.code = code;
//     }
// 
//     public static IEXOperationalHaltStatus getOperationalHaltStatus(final byte code) {
//         return lookup(IEXOperationalHaltStatus.class, LOOKUP, code);
//     }
// 
//     @Override
//     public byte getCode() {
//         return code;
//     }
// }
// 
// Path: iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/util/IEXByteConverter.java
// public class IEXByteConverter {
// 
//     private IEXByteConverter() {
//     }
// 
//     public static long convertBytesToLong(final byte[] bytes) {
//         return (long) (0xff & bytes[7]) << 56 |
//                 (long) (0xff & bytes[6]) << 48 |
//                 (long) (0xff & bytes[5]) << 40 |
//                 (long) (0xff & bytes[4]) << 32 |
//                 (long) (0xff & bytes[3]) << 24 |
//                 (long) (0xff & bytes[2]) << 16 |
//                 (long) (0xff & bytes[1]) << 8 |
//                 (long) (0xff & bytes[0]) << 0;
//     }
// 
//     public static int convertBytesToInt(final byte[] bytes) {
//         return ((0xff & bytes[3]) << 24 |
//                 (0xff & bytes[2]) << 16 |
//                 (0xff & bytes[1]) << 8 |
//                 (0xff & bytes[0]) << 0
//         );
//     }
// 
//     public static byte[] toByteArray(int value) {
//         return new byte[]{
//                 (byte) value,
//                 (byte) (value >> 8 & 0xFF),
//                 (byte) (value >> 16 & 0xFF),
//                 (byte) (value >> 24 & 0xFF)};
//     }
// 
//     public static int convertBytesToUnsignedShort(final byte[] bytes) {
//         return convertBytesToShort(bytes) & 0xffff;
//     }
// 
//     public static short convertBytesToShort(final byte[] bytes) {
//         return (short) (
//                 (0xff & bytes[1]) << 8 |
//                         (0xff & bytes[0]) << 0);
//     }
// 
//     public static String convertBytesToString(final byte[] bytes) {
//         return new String(bytes).trim();
//     }
// 
//     public static IEXPrice convertBytesToIEXPrice(final byte[] bytes) {
//         return new IEXPrice(convertBytesToLong(bytes));
//     }
// 
//     public static byte[] convertToRightPaddedString(final String value, final int size) {
//         byte[] outputArray = new byte[size];
//         Arrays.fill(outputArray, (byte) ' ');
//         final byte[] valueArray = value.getBytes(StandardCharsets.UTF_8);
//         if (valueArray.length > outputArray.length) {
//             throw new ArrayIndexOutOfBoundsException();
//         }
//         System.arraycopy(valueArray, 0, outputArray, 0, valueArray.length);
//         return outputArray;
//     }
// }


// Path: iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/message/administrative/IEXOperationalHaltStatusMessage.java
import pl.zankowski.iextrading4j.hist.api.message.IEXMessage;
import pl.zankowski.iextrading4j.hist.api.message.administrative.field.IEXOperationalHaltStatus;
import pl.zankowski.iextrading4j.hist.api.util.IEXByteConverter;
import java.util.Arrays;
import java.util.Objects;
import static pl.zankowski.iextrading4j.hist.api.IEXMessageType.OPERATIONAL_HALT_STATUS;

package pl.zankowski.iextrading4j.hist.api.message.administrative;




public class IEXOperationalHaltStatusMessage extends IEXMessage {

    public static final int LENGTH = 18;

    private final IEXOperationalHaltStatus operationalHaltStatus;
    private final long timestamp;
    private final String symbol;

    private IEXOperationalHaltStatusMessage(
            final IEXOperationalHaltStatus operationalHaltStatus,
            final long timestamp,
            final String symbol) {
        super(OPERATIONAL_HALT_STATUS);
        this.operationalHaltStatus = operationalHaltStatus;
        this.timestamp = timestamp;
        this.symbol = symbol;
    }

    public static IEXOperationalHaltStatusMessage createIEXMessage(final byte[] bytes) {
        final IEXOperationalHaltStatus operationalHaltStatus = IEXOperationalHaltStatus.getOperationalHaltStatus(bytes[1]);
        final long timestamp = IEXByteConverter.convertBytesToLong(Arrays.copyOfRange(bytes, 2, 10));
        final String symbol = IEXByteConverter.convertBytesToString(Arrays.copyOfRange(bytes, 10, 18));

        return new IEXOperationalHaltStatusMessage(operationalHaltStatus, timestamp, symbol);
    }

    public IEXOperationalHaltStatus getOperationalHaltStatus() {
        return operationalHaltStatus;