// Path: op1/src/main/java/com/op1/iff/Chunk.java
// public interface Chunk {
// 
//     /**
//      * Returns the ID of this chunk.
//      */
//     ID getChunkID();
// 
//     /**
//      * Returns the size in bytes of the data portion of the chunk. The count does not include the 8 bytes used by the
//      * chunk ID and chunk size. Also, please note, when the data portion of a chunk contains an odd number of bytes,
//      * chunk readers should expect to read an extra pad byte (0) which is also not included in the chunk size count.
//      */
//     SignedLong getChunkSize();
// 
//     /**
//      * Returns the actual number of bytes used to represent this Chunk. This should be equal to the value returned by
//      * getChunkSize() + 8 [+1 if getChunkSize() is odd].
//      */
//     int getPhysicalSize();
// }
// 
// Path: op1/src/main/java/com/op1/iff/IffReader.java
// public class IffReader implements Closeable {
// 
//     private final DataInputStream dataInputStream;
// 
//     public IffReader(DataInputStream dataInputStream) {
//         this.dataInputStream = dataInputStream;
//     }
// 
//     public SignedChar readSignedChar() throws IOException {
//         return new SignedChar(dataInputStream.readByte());
//     }
// 
//     public UnsignedChar readUnsignedChar() throws IOException {
//         return new UnsignedChar(dataInputStream.readByte());
//     }
// 
//     public SignedShort readSignedShort() throws IOException {
//         return new SignedShort(readBytes(2));
//     }
// 
//     public UnsignedShort readUnsignedShort() throws IOException {
//         return new UnsignedShort(readBytes(2));
//     }
// 
//     public SignedLong readSignedLong() throws IOException {
//         return new SignedLong(readBytes(4));
//     }
// 
//     public UnsignedLong readUnsignedLong() throws IOException {
//         return new UnsignedLong(readBytes(4));
//     }
// 
//     public Extended readExtended() throws IOException {
//         return new Extended(readBytes(10));
//     }
// 
//     public PString readPString() throws IOException {
// 
//         // The first byte contains a count of the text textBytes that follow.
//         final int numTextBytes = dataInputStream.readUnsignedByte();
// 
//         // Read the text bytes.
//         final byte[] textBytes = readBytes(numTextBytes);
// 
//         // The total number of textBytes should be even. A pad byte may have been added to satisfy this rule.
//         int numPadBytes = (numTextBytes + 1) % 2;
// 
//         byte[] pStringBytes = new byte[1 + numTextBytes + numPadBytes];
//         pStringBytes[0] = (byte) numTextBytes;
//         System.arraycopy(textBytes, 0, pStringBytes, 1, textBytes.length);
//         if (numPadBytes == 1) {
//             pStringBytes[pStringBytes.length - 1] = dataInputStream.readByte();
//         }
//         return new PString(pStringBytes);
//     }
// 
//     public ID readID() throws IOException {
//         return new ID(readBytes(4));
//     }
// 
//     public OSType readOSType() throws IOException {
//         return new OSType(readBytes(4));
//     }
// 
//     public byte[] readBytes(int numBytesToRead) throws IOException {
//         final byte[] bytes = new byte[numBytesToRead];
//         final int numRead = dataInputStream.read(bytes);
//         if (numRead != numBytesToRead) {
//             throw new EOFException(String.format("numBytesToRead: %s, numRead: %s", numBytesToRead, numRead));
//         }
//         return bytes;
//     }
// 
//     public byte readByte() throws IOException {
//         return dataInputStream.readByte();
//     }
// 
//     public void close() throws IOException {
//         dataInputStream.close();
//     }
// }
// 
// Path: op1/src/main/java/com/op1/util/Check.java
// public class Check {
// 
//     public static <T> T notNull(T t, String message) {
//         if (t == null) {
//             throw new IllegalArgumentException(message);
//         }
//         return t;
//     }
// 
//     public static void that(boolean b, String message) {
//         if (!b) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
//     public static void state(boolean b, String message) {
//         if (!b) {
//             throw new IllegalStateException(message);
//         }
//     }
// }


import com.op1.iff.Chunk;
import com.op1.iff.IffReader;
import com.op1.iff.types.*;
import com.op1.util.Check;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
        if (!sampleSize.equals(that.sampleSize)) return false;
        if (!sampleRate.equals(that.sampleRate)) return false;
        if (!codec.equals(that.codec)) return false;
        return description.equals(that.description);

    }

    @Override
    public int hashCode() {
        int result = chunkId.hashCode();
        result = 31 * result + chunkSize.hashCode();
        result = 31 * result + numChannels.hashCode();
        result = 31 * result + numSampleFrames.hashCode();
        result = 31 * result + sampleSize.hashCode();
        result = 31 * result + sampleRate.hashCode();
        result = 31 * result + codec.hashCode();
        result = 31 * result + description.hashCode();
        return result;
    }

    public static class Builder {

        private final CommonChunk instance;

        public Builder() {
            instance = new CommonChunk();
        }

        public CommonChunk build() {

// Path: op1/src/main/java/com/op1/iff/Chunk.java
// public interface Chunk {
// 
//     /**
//      * Returns the ID of this chunk.
//      */
//     ID getChunkID();
// 
//     /**
//      * Returns the size in bytes of the data portion of the chunk. The count does not include the 8 bytes used by the
//      * chunk ID and chunk size. Also, please note, when the data portion of a chunk contains an odd number of bytes,
//      * chunk readers should expect to read an extra pad byte (0) which is also not included in the chunk size count.
//      */
//     SignedLong getChunkSize();
// 
//     /**
//      * Returns the actual number of bytes used to represent this Chunk. This should be equal to the value returned by
//      * getChunkSize() + 8 [+1 if getChunkSize() is odd].
//      */
//     int getPhysicalSize();
// }
// 
// Path: op1/src/main/java/com/op1/iff/IffReader.java
// public class IffReader implements Closeable {
// 
//     private final DataInputStream dataInputStream;
// 
//     public IffReader(DataInputStream dataInputStream) {
//         this.dataInputStream = dataInputStream;
//     }
// 
//     public SignedChar readSignedChar() throws IOException {
//         return new SignedChar(dataInputStream.readByte());
//     }
// 
//     public UnsignedChar readUnsignedChar() throws IOException {
//         return new UnsignedChar(dataInputStream.readByte());
//     }
// 
//     public SignedShort readSignedShort() throws IOException {
//         return new SignedShort(readBytes(2));
//     }
// 
//     public UnsignedShort readUnsignedShort() throws IOException {
//         return new UnsignedShort(readBytes(2));
//     }
// 
//     public SignedLong readSignedLong() throws IOException {
//         return new SignedLong(readBytes(4));
//     }
// 
//     public UnsignedLong readUnsignedLong() throws IOException {
//         return new UnsignedLong(readBytes(4));
//     }
// 
//     public Extended readExtended() throws IOException {
//         return new Extended(readBytes(10));
//     }
// 
//     public PString readPString() throws IOException {
// 
//         // The first byte contains a count of the text textBytes that follow.
//         final int numTextBytes = dataInputStream.readUnsignedByte();
// 
//         // Read the text bytes.
//         final byte[] textBytes = readBytes(numTextBytes);
// 
//         // The total number of textBytes should be even. A pad byte may have been added to satisfy this rule.
//         int numPadBytes = (numTextBytes + 1) % 2;
// 
//         byte[] pStringBytes = new byte[1 + numTextBytes + numPadBytes];
//         pStringBytes[0] = (byte) numTextBytes;
//         System.arraycopy(textBytes, 0, pStringBytes, 1, textBytes.length);
//         if (numPadBytes == 1) {
//             pStringBytes[pStringBytes.length - 1] = dataInputStream.readByte();
//         }
//         return new PString(pStringBytes);
//     }
// 
//     public ID readID() throws IOException {
//         return new ID(readBytes(4));
//     }
// 
//     public OSType readOSType() throws IOException {
//         return new OSType(readBytes(4));
//     }
// 
//     public byte[] readBytes(int numBytesToRead) throws IOException {
//         final byte[] bytes = new byte[numBytesToRead];
//         final int numRead = dataInputStream.read(bytes);
//         if (numRead != numBytesToRead) {
//             throw new EOFException(String.format("numBytesToRead: %s, numRead: %s", numBytesToRead, numRead));
//         }
//         return bytes;
//     }
// 
//     public byte readByte() throws IOException {
//         return dataInputStream.readByte();
//     }
// 
//     public void close() throws IOException {
//         dataInputStream.close();
//     }
// }
// 
// Path: op1/src/main/java/com/op1/util/Check.java
// public class Check {
// 
//     public static <T> T notNull(T t, String message) {
//         if (t == null) {
//             throw new IllegalArgumentException(message);
//         }
//         return t;
//     }
// 
//     public static void that(boolean b, String message) {
//         if (!b) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
//     public static void state(boolean b, String message) {
//         if (!b) {
//             throw new IllegalStateException(message);
//         }
//     }
// }


// Path: op1/src/main/java/com/op1/aiff/CommonChunk.java
import com.op1.iff.Chunk;
import com.op1.iff.IffReader;
import com.op1.iff.types.*;
import com.op1.util.Check;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

        if (!sampleSize.equals(that.sampleSize)) return false;
        if (!sampleRate.equals(that.sampleRate)) return false;
        if (!codec.equals(that.codec)) return false;
        return description.equals(that.description);

    }

    @Override
    public int hashCode() {
        int result = chunkId.hashCode();
        result = 31 * result + chunkSize.hashCode();
        result = 31 * result + numChannels.hashCode();
        result = 31 * result + numSampleFrames.hashCode();
        result = 31 * result + sampleSize.hashCode();
        result = 31 * result + sampleRate.hashCode();
        result = 31 * result + codec.hashCode();
        result = 31 * result + description.hashCode();
        return result;
    }

    public static class Builder {

        private final CommonChunk instance;

        public Builder() {
            instance = new CommonChunk();
        }

        public CommonChunk build() {

            Check.notNull(instance.chunkId, "Missing chunkId");