packfile

package
v0.4.16-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2023 License: ISC Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_CHUNK  = 1
	TYPE_OBJECT = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	DataType uint8
	Checksum [32]byte
	Offset   uint32
	Length   uint32
}

type PackFile

type PackFile struct {
	Data  []byte
	Index []Chunk
}

func New

func New() *PackFile

func NewFromBytes

func NewFromBytes(serialized []byte) (*PackFile, error)

func (*PackFile) AddData

func (p *PackFile) AddData(dataType uint8, checksum [32]byte, data []byte)

func (*PackFile) GetChunk

func (p *PackFile) GetChunk(checksum [32]byte) ([]byte, bool)

func (*PackFile) Serialize

func (p *PackFile) Serialize() ([]byte, error)

func (*PackFile) Size

func (p *PackFile) Size() uint32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL