io

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompressedInputStream

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

CompressedInputStream a Reader that reads compressed data from an InputBitStream.

func NewCompressedInputStream

func NewCompressedInputStream(is io.ReadCloser, jobs uint) (*CompressedInputStream, error)

NewCompressedInputStream creates a new instance of CompressedInputStream

func NewCompressedInputStreamWithCtx

func NewCompressedInputStreamWithCtx(is io.ReadCloser, ctx map[string]interface{}) (*CompressedInputStream, error)

NewCompressedInputStreamWithCtx creates a new instance of CompressedInputStream using a map of parameters

func NewCompressedInputStreamWithCtx2 added in v1.9.0

func NewCompressedInputStreamWithCtx2(ibs kanzi.InputBitStream, ctx map[string]interface{}) (*CompressedInputStream, error)

NewCompressedInputStreamWithCtx2 creates a new instance of CompressedInputStream using a map of parameters and a custom input bitstream

func (*CompressedInputStream) AddListener

func (this *CompressedInputStream) AddListener(bl kanzi.Listener) bool

AddListener adds an event listener to this input stream. Returns true if the listener has been added.

func (*CompressedInputStream) Close

func (this *CompressedInputStream) Close() error

Close reads the buffered data intto the input stream and releases resources. Close makes the bitstream unavailable for further reads. Idempotent

func (*CompressedInputStream) GetRead

func (this *CompressedInputStream) GetRead() uint64

GetRead returns the number of bytes read so far

func (*CompressedInputStream) Read

func (this *CompressedInputStream) Read(block []byte) (int, error)

Read reads up to len(block) bytes into block. It returns the number of bytes read (0 <= n <= len(block)) and any error encountered.

func (*CompressedInputStream) RemoveListener

func (this *CompressedInputStream) RemoveListener(bl kanzi.Listener) bool

RemoveListener removes an event listener from this input stream. Returns true if the listener has been removed.

type CompressedOutputStream

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

CompressedOutputStream a Writer that writes compressed data to an OutputBitStream.

func NewCompressedOutputStream

func NewCompressedOutputStream(os io.WriteCloser, codec, transform string, blockSize, jobs uint, checksum bool) (*CompressedOutputStream, error)

NewCompressedOutputStream creates a new instance of CompressedOutputStream

func NewCompressedOutputStreamWithCtx

func NewCompressedOutputStreamWithCtx(os io.WriteCloser, ctx map[string]interface{}) (*CompressedOutputStream, error)

NewCompressedOutputStreamWithCtx creates a new instance of CompressedOutputStream using a map of parameters and a writer

func NewCompressedOutputStreamWithCtx2 added in v1.9.0

func NewCompressedOutputStreamWithCtx2(obs kanzi.OutputBitStream, ctx map[string]interface{}) (*CompressedOutputStream, error)

NewCompressedOutputStreamWithCtx2 creates a new instance of CompressedOutputStream using a map of parameters and a custom output bitstream

func (*CompressedOutputStream) AddListener

func (this *CompressedOutputStream) AddListener(bl kanzi.Listener) bool

AddListener adds an event listener to this output stream. Returns true if the listener has been added.

func (*CompressedOutputStream) Close

func (this *CompressedOutputStream) Close() error

Close writes the buffered data to the output stream then writes a final empty block and releases resources. Close makes the bitstream unavailable for further writes. Idempotent.

func (*CompressedOutputStream) GetWritten

func (this *CompressedOutputStream) GetWritten() uint64

GetWritten returns the number of bytes written so far

func (*CompressedOutputStream) RemoveListener

func (this *CompressedOutputStream) RemoveListener(bl kanzi.Listener) bool

RemoveListener removes an event listener from this output stream. Returns true if the listener has been removed.

func (*CompressedOutputStream) Write

func (this *CompressedOutputStream) Write(block []byte) (int, error)

Write writes len(block) bytes from block to the underlying data stream. It returns the number of bytes written from block (0 <= n <= len(block)) and any error encountered that caused the write to stop early.

type IOError

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

IOError an extended error containing a message and a code value

func (IOError) Error

func (this IOError) Error() string

Error returns the underlying error

func (IOError) ErrorCode

func (this IOError) ErrorCode() int

ErrorCode returns the code value associated with the error

func (IOError) Message

func (this IOError) Message() string

Message returns the message string associated with the error

type NullOutputStream

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

NullOutputStream similar to io.Discard but implements io.WriteCloser

func NewNullOutputStream

func NewNullOutputStream() (*NullOutputStream, error)

NewNullOutputStream creates an instance of NullOutputStream

func (*NullOutputStream) Close

func (this *NullOutputStream) Close() error

Close makes the stream unavailable for further writes

func (*NullOutputStream) Write

func (this *NullOutputStream) Write(b []byte) (n int, err error)

Write panics if the stream is closed else does nothing.

Jump to

Keyboard shortcuts

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