compressor

package
v0.0.0-...-e6e2d5c Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const CommDataBlockSize = 4096
View Source
const CommHeaderSize = 16
View Source
const InnerHeaderSize = 32

Variables

View Source
var Compressors = [...]func([]byte) []byte{
	Zerocompressor,
	LZMAcompressor,
	GZIPcompressor,
}
View Source
var Decompressors = [...]func(<-chan []byte, chan<- []byte, *sync.WaitGroup){
	ZeroDecompressor,
	LZMADecompressor,
	GZIPDecompressor,
}

Functions

func ClientBlockAssembly

func ClientBlockAssembly(inCh <-chan []byte, out []chan []byte, wg *sync.WaitGroup, db int, voidCh chan []byte)

func CloseByteChan

func CloseByteChan(out []chan []byte, name string)

func GZIPDecompressor

func GZIPDecompressor(inCh <-chan []byte, out chan<- []byte, wg *sync.WaitGroup)

func GZIPcompressor

func GZIPcompressor(inp []byte) []byte

func GetInnerCompression

func GetInnerCompression(msg []byte) uint16

func JavaTSNow

func JavaTSNow() uint64

func LZMADecompressor

func LZMADecompressor(inCh <-chan []byte, out chan<- []byte, wg *sync.WaitGroup)

func LZMAcompressor

func LZMAcompressor(inp []byte) []byte

func SetHeader

func SetHeader(block []byte, header TheHeader)

func SetInnerHeader

func SetInnerHeader(block []byte, header InnerHeader)

func ZeroDecompressor

func ZeroDecompressor(inCh <-chan []byte, out chan<- []byte, wg *sync.WaitGroup)

func Zerocompressor

func Zerocompressor(in []byte) []byte

Types

type CompressableData

type CompressableData struct {
	Datatype uint16
	Data     []byte
}

type CompressedData

type CompressedData struct {
	Header InnerHeader
	Data   []byte
}

type InnerHeader

type InnerHeader struct {
	Compression uint16 // 0
	//
	Datatype uint16 // 2
	//
	Uncompressed uint32 // 4
	HASH         uint64 // 8
	TS           uint64 // 16
	Reserved2    uint64 // 24
}

func GetInnerHeader

func GetInnerHeader(msg []byte) (InnerHeader, []byte)

type TheHeader

type TheHeader struct {
	//
	BlockSize uint16 //0
	//
	Queue    uint8  // 2
	Reserved uint8  // 3
	Msg      uint32 // 4
	//
	Offset   uint32 // 8
	RestSize uint32 // 12
}

func GetHeader

func GetHeader(msg []byte) TheHeader

type TheMessage

type TheMessage []byte

func (TheMessage) String

func (b TheMessage) String() string

Jump to

Keyboard shortcuts

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