gzip

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package gzip provides a streaming object for taking in io.ReadCloser that is being written to and providing an io.ReadCloser that outputs the original content gzip compressed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Streamer

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

Streamer implements an io.ReadCloser that converts data from a non-compressed stream to a compressed stream.

func New

func New() *Streamer

New creates a new streamer object. Use Reset() to initialize it.

func (*Streamer) Close

func (s *Streamer) Close() error

Close implements io.Closer.

func (*Streamer) Read

func (s *Streamer) Read(b []byte) (int, error)

Read implements io.Reader.

func (*Streamer) Reset

func (s *Streamer) Reset(reader io.ReadCloser)

Reset resets the streamer object to defaults and accepts the io.ReadCloser. You can only use Reset after a previous reader has closed.

func (*Streamer) Size

func (s *Streamer) Size() int64

Size returns the amount of data that the Streamer streamed. This will only be accurate for the full stream after Read() has returned io.EOF and not before.

Jump to

Keyboard shortcuts

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