1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.zmpp.iff;
24
25 import org.zmpp.base.MemoryAccess;
26
27 /***
28 * The basic data structure for an IFF file, a chunk.
29 *
30 * @author Wei-ju Wu
31 * @version 1.0
32 */
33 public interface Chunk {
34
35 /***
36 * The length of an IFF chunk id in bytes.
37 */
38 static final int CHUNK_ID_LENGTH = 4;
39
40 /***
41 * The length of an IFF chunk size word in bytes.
42 */
43 static final int CHUNK_SIZEWORD_LENGTH = 4;
44
45 /***
46 * The chunk header size.
47 */
48 static final int CHUNK_HEADER_LENGTH = CHUNK_ID_LENGTH
49 + CHUNK_SIZEWORD_LENGTH;
50
51 /***
52 * Returns this IFF chunk's id. An id is a 4 byte array.
53 *
54 * @return the id
55 */
56 byte[] getId();
57
58 /***
59 * The chunk data size, excluding id and size word.
60 *
61 * @return the size
62 */
63 int getSize();
64
65 /***
66 * Returns true if this is a valid chunk.
67 *
68 * @return true if valid, false otherwise
69 */
70 boolean isValid();
71
72 /***
73 * Returns a memory access object to the chunk.
74 *
75 * @return the MemoryAccess object
76 */
77 MemoryAccess getMemoryAccess();
78 }