Documentation ¶
Index ¶
- Constants
- func Compress(fileContents []byte, useProgressBar bool, maxSearchBufferLength int) []byte
- func CompressAsync(fileContents []byte, useProgressBar bool, maxSearchBufferLength int) []byte
- func CompressRecursive(fileContents []byte, _ bool, maxSearchBufferLength int) []byte
- func DecodeOpeningSymbols(bytes []byte) []byte
- func Decompress(fileContents []byte, useProgressBar bool) []byte
- func EncodeOpeningSymbols(bytes []byte) []byte
- func FindReverse(slice []byte, val byte) (int, bool)
- func FindReverseSlice(input []byte, val []byte) (int, bool)
- func FindSequential(slice []byte, val byte) (int, bool)
- func NewReader(r io.Reader) io.Reader
- func NewWriter(w io.Writer) io.WriteCloser
- func SortByteArray(src []byte)
- type Reader
- type Reference
- type Writer
Constants ¶
const ( Opening = "<" Closing = ">" Separator = "," )
const DefaultWindowSize = 4096
const EncodedOpening = 0xff
const EscapeByte = 0x5c
const MinimumSizeOfReference int = -1 // Use -1 to represent dynamic "smart" reference inclusion
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
Compress is the original LZSS compress function which takes a slice of bytes and some options and returns the compressed representation. This function is the most performant of the three implementations, I suspect because of the iterative nature, however the code is not very clean so be weary.
func CompressAsync ¶
CompressAsync is similar to Compress except that it uses goroutines to run as multi-threaded as possible
func CompressRecursive ¶
CompressRecursive exists to substitute the Compress function with better performance and simplicity from recursion. However, this implementation yields slower results than the base Compress function so should generally be unused. This remains purely as a reference for understanding the algorithm. This should not be used as there are issues with data loss with large content streams.
func DecodeOpeningSymbols ¶
func Decompress ¶
Decompress decompressed the file contents and returns the decompressed contents as a slice of bytes
func EncodeOpeningSymbols ¶
func SortByteArray ¶
func SortByteArray(src []byte)