-func (f FileNameWithInfo) Payload() []byte {
- name := f.Name
- nameSize := make([]byte, 2)
- binary.BigEndian.PutUint16(nameSize, uint16(len(name)))
+// 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[:]))
+}