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.
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
Click to show internal directories.
Click to hide internal directories.