()
| 25 | } |
| 26 | |
| 27 | func (h Header) getBytes() []byte { |
| 28 | versionBytes := make([]byte, 8) |
| 29 | binary.LittleEndian.PutUint64(versionBytes, h.Version) |
| 30 | result := make([]byte, FileFormatLength+8) |
| 31 | for i := 0; i < FileFormatLength; i++ { |
| 32 | result[i] = fileFormatBytes[i] |
| 33 | } |
| 34 | for i := 0; i < 8; i++ { |
| 35 | result[i+FileFormatLength] = versionBytes[i] |
| 36 | } |
| 37 | return result |
| 38 | } |
| 39 | |
| 40 | func newHeader(version uint64) Header { |
| 41 | return Header{ |