compression

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package compression implements the LG resource file compression algorithm.

Index

Constants

View Source
const (

	// EndOfStream indicates the last word in the compressed stream.
	EndOfStream = Word(0x3FFF)
	// Reset indicates a reset of the dictionary.
	Reset = Word(0x3FFE)
)

Variables

This section is empty.

Functions

func NewCompressor

func NewCompressor(target io.Writer) io.WriteCloser

NewCompressor creates a new compressor instance over a writer.

func NewDecompressor

func NewDecompressor(source io.Reader) io.Reader

NewDecompressor creates a new decompressor instance over a reader.

Types

type Word

type Word uint16

Word is a compression stream entry.

type WordReader

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

WordReader provides word instances from a serialized stream.

func NewWordReader

func NewWordReader(coder serial.Coder) *WordReader

NewWordReader returns a new instance.

func (*WordReader) Read

func (reader *WordReader) Read() (value Word)

Read returns the next word from the stream.

type WordWriter

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

WordWriter serializes a stream of word entries.

func NewWordWriter

func NewWordWriter(coder serial.Coder) *WordWriter

NewWordWriter returns a new instance.

func (*WordWriter) Close

func (writer *WordWriter) Close()

Close finishes the stream of words.

func (*WordWriter) Write

func (writer *WordWriter) Write(value Word)

Write adds the given word to the stream.

Jump to

Keyboard shortcuts

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