public void read(MC68000InputStream in) throws IOException { id = in.readLONG(); long length = in.readULONG(); switch (id) { case ID_CAT: case ID_FORM: case ID_LIST: case ID_PROP: type = in.readLONG(); length -= 4; while (length > 1) { MutableIFFChunk child = new MutableIFFChunk(); child.read(in); add(child); int childLength = child.getLength(); length -= childLength + childLength % 2 + 8; } break; default: data = new byte[(int) length]; in.readFully(data, 0, (int) length); break; } if (length % 2 == 1) { in.read(); } }
public void read(File f) throws IOException { MC68000InputStream in = new MC68000InputStream(new BufferedInputStream(new FileInputStream(f))); try { read(in); } finally { in.close(); } }