segmented

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCompressionLevel = zlib.BestCompression
)

Variables

View Source
var (
	Signature = append([]byte("sd0"), []byte{0x01, 0xff}...)
	ChunkSize = 0x40000
)

Functions

This section is empty.

Types

type DataReader

type DataReader struct {
	// contains filtered or unexported fields
}

func NewDataReader

func NewDataReader(r io.Reader) (*DataReader, error)

Creates a new sd0 decompressor. NewDataReader returns a nil *DataReader if the function fails to verify the signature.

func (*DataReader) Read

func (reader *DataReader) Read(p []byte) (n int, err error)

type DataWriter added in v0.8.0

type DataWriter struct {
	// contains filtered or unexported fields
}

NOTE: The live game used Python's zlib library to create sd0 files. Due to zlib implementation differences, DataWriter is NOT guaranteed to produce equivalent sd0 files as generated by lib_segmented.py within the original patcher.

This is only an issue for compressing, not decompressing.

func NewDataWriter added in v0.8.0

func NewDataWriter(w io.Writer) *DataWriter

Creates a new sd0 compressor.

func (*DataWriter) BytesCompressed added in v0.8.0

func (writer *DataWriter) BytesCompressed() int64

func (*DataWriter) Close added in v0.8.0

func (writer *DataWriter) Close() error

func (*DataWriter) Write added in v0.8.0

func (writer *DataWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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