rle

package
v0.0.0-...-ecf7a0d Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2016 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package rle implements a form of run-length encoding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Run

type Run struct {
	Byte byte
	Len  int
}

Run contains a run byte along with its length.

func (Run) Encode

func (r Run) Encode() []byte

Encode encodes a single run.

func (Run) EncodedLen

func (r Run) EncodedLen() int

EncodedLen gets the length of the encoded run.

type RunList

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

RunList contains a list of runs from data as they occurred.

func NewRunList

func NewRunList() *RunList

NewRunList creates a RunList ready to read runs.

func (RunList) Encode

func (rl RunList) Encode() []byte

Encode encodes the runs reconstructing the original data in the encoded form.

func (RunList) EncodedLen

func (rl RunList) EncodedLen() int

EncodedLen gets the encoded length of the runs.

func (*RunList) Trim

func (rl *RunList) Trim(n int) int

Trim trims a number of bytes from the encoded form of the run list. The number of bytes trimmed from the original input is returned.

func (*RunList) Update

func (rl *RunList) Update(data []byte) int

Update updates the runs with the data given. Returning the encoded length of the runs afterwards.

Jump to

Keyboard shortcuts

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