Documentation ¶
Overview ¶
Package civ3decompress is to decompress SAV and BIQ files from the game Civilization III
Package bitstream is a simple wrapper around a io.Reader and io.Writer to provide bit-level access to the stream.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decompress ¶
Decompress is implemented based on the description of PKWare Data Compression Library at https://groups.google.com/forum/#!msg/comp.compression/M5P064or93o/W1ca1-ad6kgJ However this is only a partial implementation; The Huffman-coded literals of header 0x01 are not implemented here as they are not needed for my purpose
func DecompressByteArray ¶
DecompressByteArray is a May 2020 attempt at speeding up decompression by eliminating the reader interfaces and frequent function calls TODO: `bytes` is a horrible name for a variable as there is a bytes package. I should probably change it someday.
Types ¶
type BitReader ¶
type BitReader struct {
// contains filtered or unexported fields
}
A BitReader reads bits from an io.Reader
func (*BitReader) ReadBit ¶
ReadBit returns the next bit from the stream, reading a new byte from the underlying reader if required.
type DecodeError ¶
type DecodeError struct {
// contains filtered or unexported fields
}
DecodeError is when the data does not match an expected pattern. Pass it message string.
func (DecodeError) Error ¶
func (e DecodeError) Error() string