- Type []byte // file type code
- Creator []byte // File creator code
- FileSize []byte // File Size in bytes
- RSVD []byte
- NameScript []byte // TODO: What is this?
- NameSize []byte // Length of name field
- Name []byte // File name
+ fileNameWithInfoHeader
+ Name []byte // File Name
+
+ readOffset int // Internal offset to track read progress
+}
+
+// fileNameWithInfoHeader contains the fixed length fields of FileNameWithInfo
+type fileNameWithInfoHeader struct {
+ Type [4]byte // File type code
+ Creator [4]byte // File creator code
+ FileSize [4]byte // File Size in bytes
+ RSVD [4]byte
+ NameScript [2]byte // ??
+ NameSize [2]byte // Length of Name field
+}
+
+func (f *fileNameWithInfoHeader) nameLen() int {
+ return int(binary.BigEndian.Uint16(f.NameSize[:]))