lib

package module
v0.0.0-...-69734e4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 5 Imported by: 1

README

zb64/lib

core library providing zip-base64-encoder/decoder.

Documentation

Overview

Package lib provides encoder and decoder for base64-encoded compressed string.

Index

Constants

This section is empty.

Variables

View Source
var Deflate = newDataFormat(
	func(buf io.Writer) io.WriteCloser {
		w, _ := flate.NewWriter(buf, flate.BestCompression)
		return w
	},
	func(buf io.Reader) (io.ReadCloser, error) {
		return flate.NewReader(buf), nil
	},
)

Deflate is a wrapper of DEFLATE compressed data format, provided by compress/flate.

View Source
var LzwLSB = newDataFormat(
	func(buf io.Writer) io.WriteCloser {
		return lzw.NewWriter(buf, lzw.LSB, lzwLitWidth)
	},
	func(buf io.Reader) (io.ReadCloser, error) {
		return lzw.NewReader(buf, lzw.LSB, lzwLitWidth), nil
	},
)

LzwMSB is a wrapper of Lempel-Ziv-Welch compressed data format using Least Significant Bits, provided by compress/lzw.

View Source
var LzwMSB = newDataFormat(
	func(buf io.Writer) io.WriteCloser {
		return lzw.NewWriter(buf, lzw.MSB, lzwLitWidth)
	},
	func(buf io.Reader) (io.ReadCloser, error) {
		return lzw.NewReader(buf, lzw.MSB, lzwLitWidth), nil
	},
)

LzwMSB is a wrapper of Lempel-Ziv-Welch compressed data format using Most Significant Bits, provided by compress/lzw.

View Source
var Plain = newDataFormat(
	func(buf io.Writer) io.WriteCloser {
		return NewPlainWriter(buf)
	},
	func(buf io.Reader) (io.ReadCloser, error) {
		return NewPlainReader(buf), nil
	},
)

Plain is a wrapper of plain text format, no compression.

Functions

This section is empty.

Types

type PlainReader

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

func NewPlainReader

func NewPlainReader(r io.Reader) *PlainReader

func (*PlainReader) Close

func (*PlainReader) Close() error

func (*PlainReader) Read

func (r *PlainReader) Read(p []byte) (n int, err error)

type PlainWriter

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

func NewPlainWriter

func NewPlainWriter(w io.Writer) *PlainWriter

func (*PlainWriter) Close

func (*PlainWriter) Close() error

func (*PlainWriter) Write

func (w *PlainWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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