ch_encoding

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NONE CompressionMethodByte = 0x02
	LZ4                        = 0x82
	ZSTD                       = 0x90
)
View Source
const (
	// ChecksumSize is 128bits for cityhash102 checksum
	ChecksumSize = 16
	// CompressHeader magic + compressed_size + uncompressed_size
	CompressHeaderSize = 1 + 4 + 4

	// HeaderSize
	HeaderSize = ChecksumSize + CompressHeaderSize
	// BlockMaxSize 1MB
	BlockMaxSize = 1 << 20
)

Variables

This section is empty.

Functions

func NewCompressReader

func NewCompressReader(r io.Reader) *compressReader

NewCompressReader wrap the io.Reader

func NewCompressWriter

func NewCompressWriter(w io.Writer) *compressWriter

NewCompressWriter wrap the io.Writer

Types

type CompressionMethodByte

type CompressionMethodByte byte

type Decoder

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

func NewDecoder

func NewDecoder(input io.Reader) *Decoder

func NewDecoderWithCompress

func NewDecoderWithCompress(input io.Reader) *Decoder

func (*Decoder) Bool

func (dec *Decoder) Bool() (bool, error)

func (*Decoder) GetInput

func (dec *Decoder) GetInput() io.Reader

func (*Decoder) GetUvarInput

func (dec *Decoder) GetUvarInput() UvarintReader

func (*Decoder) Int32

func (dec *Decoder) Int32() (int32, error)

func (*Decoder) IsCompressed

func (dec *Decoder) IsCompressed() bool

func (*Decoder) Read

func (dec *Decoder) Read(b []byte) (int, error)

Read reads up to len(p) bytes into input reader

func (*Decoder) SetCompress

func (dec *Decoder) SetCompress(compress bool)

func (*Decoder) String

func (dec *Decoder) String() (string, error)

func (*Decoder) UInt32

func (dec *Decoder) UInt32() (uint32, error)

func (*Decoder) UInt64

func (dec *Decoder) UInt64() (uint64, error)

func (*Decoder) Uvarint

func (dec *Decoder) Uvarint() (uint64, error)

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func NewEncoderWithCompress

func NewEncoderWithCompress(w io.Writer) *Encoder

func (*Encoder) Bool

func (enc *Encoder) Bool(b bool) error

func (*Encoder) Float32

func (enc *Encoder) Float32(f float32) error

func (*Encoder) Float64

func (enc *Encoder) Float64(f float64) error

func (*Encoder) Flush

func (enc *Encoder) Flush() error

func (*Encoder) GetOutput

func (enc *Encoder) GetOutput() io.Writer

func (*Encoder) Int32

func (enc *Encoder) Int32(v int32) error

func (*Encoder) IsCompressed

func (enc *Encoder) IsCompressed() bool

func (*Encoder) SelectCompress

func (enc *Encoder) SelectCompress(compress bool)

func (*Encoder) String

func (enc *Encoder) String(s string) error

func (*Encoder) UInt32

func (enc *Encoder) UInt32(v uint32) error

func (*Encoder) UInt64

func (enc *Encoder) UInt64(v uint64) error

func (*Encoder) Uvarint

func (enc *Encoder) Uvarint(i uint64) error

func (*Encoder) Write

func (enc *Encoder) Write(p []byte) (n int, err error)

Write writes len(p) bytes from p to the output data stream

type Flusher

type Flusher interface {
	Flush() error
}

type UvarintReader

type UvarintReader interface {
	ReadUvarint() (uint64, error)
}

type WriteFlusher

type WriteFlusher interface {
	Flush() error
}

Jump to

Keyboard shortcuts

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