@@ -0,0 +1,3243 @@
+package com.op1.aiff;%0A%0Aimport com.op1.iff.Chunk;%0Aimport com.op1.iff.IffReader;%0Aimport com.op1.iff.types.ID;%0Aimport com.op1.iff.types.OSType;%0Aimport com.op1.iff.types.SignedChar;%0Aimport com.op1.iff.types.SignedLong;%0Aimport com.op1.util.Check;%0A%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Apublic class ApplicationChunk implements Chunk %7B%0A%0A    private final ID chunkId = ChunkType.APPLICATION.getId();   // 4 bytes%0A    private SignedLong chunkSize;                               // 4 bytes%0A    private OSType applicationSignature;                        // 4 bytes%0A    private SignedChar%5B%5D data;                                  // 2 bytes per item%0A%0A    private ApplicationChunk() %7B%0A    %7D%0A%0A    private ApplicationChunk(ApplicationChunk chunk) %7B%0A        this.chunkSize = chunk.getChunkSize();%0A        this.applicationSignature = chunk.getApplicationSignature();%0A        this.data = Arrays.copyOf(chunk.getData(), chunk.getData().length);%0A    %7D%0A%0A    @Override%0A    public ID getChunkID() %7B%0A        return chunkId;%0A    %7D%0A%0A    public SignedLong getChunkSize() %7B%0A        return chunkSize;%0A    %7D%0A%0A    public OSType getApplicationSignature() %7B%0A        return applicationSignature;%0A    %7D%0A%0A    public SignedChar%5B%5D getData() %7B%0A        return Arrays.copyOf(data, data.length);%0A    %7D%0A%0A    public static class Builder %7B%0A%0A        private final ApplicationChunk instance;%0A%0A        public Builder() %7B%0A            instance = new ApplicationChunk();%0A        %7D%0A%0A        public ApplicationChunk build() %7B%0A            Check.notNull(instance.chunkSize, %22Missing chunkSize%22);%0A            Check.notNull(instance.applicationSignature, %22Missing applicationSignature%22);%0A            Check.notNull(instance.getData(), %22Missing data%22);%0A            return new ApplicationChunk(instance);%0A        %7D%0A%0A        public Builder withChunkSize(SignedLong chunkSize) %7B%0A            instance.chunkSize = chunkSize;%0A            return this;%0A        %7D%0A%0A        public Builder withApplicationSignature(OSType applicationSignature) %7B%0A            instance.applicationSignature = applicationSignature;%0A            return this;%0A        %7D%0A%0A        public Builder withData(SignedChar%5B%5D data) %7B%0A            instance.data = data;%0A            return this;%0A        %7D%0A    %7D%0A%0A    public static ApplicationChunk readApplicationChunk(IffReader reader) throws IOException %7B%0A%0A        SignedLong chunkSize = reader.readSignedLong();%0A        OSType applicationSignature = reader.readOSType();%0A%0A        int numCharsToRead = (chunkSize.toInt() - 4);%0A        List%3CSignedChar%3E data = new ArrayList%3CSignedChar%3E();%0A        for (int i = 0; i %3C numCharsToRead; i++) %7B%0A            data.add(reader.readSignedChar());%0A        %7D%0A        final SignedChar%5B%5D dataArray = data.toArray(new SignedChar%5Bdata.size()%5D);%0A%0A        return new ApplicationChunk.Builder()%0A                .withChunkSize(chunkSize)%0A                .withApplicationSignature(applicationSignature)%0A                .withData(dataArray)%0A                .build();%0A    %7D%0A%0A    public static class ApplicationChunkReader implements ChunkReader %7B%0A        @Override%0A        public Chunk readChunk(IffReader reader) throws IOException %7B%0A            return readApplicationChunk(reader);%0A        %7D%0A    %7D%0A%7D%0A

Create ApplicationChunk.java