adaptive

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompressInfo added in v0.7.0

type CompressInfo struct {
	PkgId          int
	CompressType   int
	DataLen        int //original data
	CompressTime   int64
	TranportTime   int64
	DecompressTime int64
	CompressRatio  float64
}

type Reader

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

func NewReader

func NewReader(r io.Reader, reportFunc ReportFunction) *Reader

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

type ReportFunction added in v0.7.0

type ReportFunction func(CompressInfo)

type Reporter added in v0.7.0

type Reporter interface {
	Report(CompressInfo)
}

type Writer

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

customized protocol writer

func NewWriter

func NewWriter(w io.Writer, bufSize int) *Writer

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) Flush

func (w *Writer) Flush() error

func (*Writer) Report added in v0.7.0

func (w *Writer) Report(info CompressInfo)

func (*Writer) Write

func (w *Writer) Write(p []byte) (nRet int, errRet error)

Jump to

Keyboard shortcuts

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