io

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChanToRawWriter added in v1.9.1

func ChanToRawWriter(writer io.Writer, stream <-chan *alloc.Buffer) error

func ChanToWriter added in v1.9.1

func ChanToWriter(writer Writer, stream <-chan *alloc.Buffer) error

ChanToWriter dumps all content from a given chan to a writer until the chan is closed.

func RawReaderToChan added in v1.9.1

func RawReaderToChan(stream chan<- *alloc.Buffer, reader io.Reader) error

func ReadFrom added in v1.9.1

func ReadFrom(reader io.Reader, buffer *alloc.Buffer) (*alloc.Buffer, error)

ReadFrom reads from a reader and put all content to a buffer. If buffer is nil, ReadFrom creates a new normal buffer.

func ReaderToChan added in v1.9.1

func ReaderToChan(stream chan<- *alloc.Buffer, reader Reader) error

ReaderToChan dumps all content from a given reader to a chan by constantly reading it until EOF.

Types

type AdaptiveReader added in v1.9.1

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

AdaptiveReader is a Reader that adjusts its reading speed automatically.

func NewAdaptiveReader added in v1.9.1

func NewAdaptiveReader(reader io.Reader) *AdaptiveReader

NewAdaptiveReader creates a new AdaptiveReader.

func (*AdaptiveReader) Read added in v1.9.1

func (this *AdaptiveReader) Read() (*alloc.Buffer, error)

Read implements Reader.Read().

type AdaptiveWriter added in v1.9.1

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

AdaptiveWriter is a Writer that writes alloc.Buffer into underlying writer.

func NewAdaptiveWriter added in v1.9.1

func NewAdaptiveWriter(writer io.Writer) *AdaptiveWriter

NewAdaptiveWriter creates a new AdaptiveWriter.

func (*AdaptiveWriter) Write added in v1.9.1

func (this *AdaptiveWriter) Write(buffer *alloc.Buffer) error

Write implements Writer.Write().

type BufferedReader added in v1.9.1

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

func NewBufferedReader added in v1.9.1

func NewBufferedReader(rawReader io.Reader) *BufferedReader

func (*BufferedReader) Cached added in v1.9.1

func (this *BufferedReader) Cached() bool

func (*BufferedReader) Read added in v1.9.1

func (this *BufferedReader) Read(b []byte) (int, error)

func (*BufferedReader) Release added in v1.9.1

func (this *BufferedReader) Release()

func (*BufferedReader) SetCached added in v1.9.1

func (this *BufferedReader) SetCached(cached bool)

type BufferedWriter added in v1.9.1

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

func NewBufferedWriter added in v1.9.1

func NewBufferedWriter(rawWriter io.Writer) *BufferedWriter

func (*BufferedWriter) Cached added in v1.9.1

func (this *BufferedWriter) Cached() bool

func (*BufferedWriter) Flush added in v1.9.1

func (this *BufferedWriter) Flush() error

func (*BufferedWriter) Release added in v1.9.1

func (this *BufferedWriter) Release()

func (*BufferedWriter) SetCached added in v1.9.1

func (this *BufferedWriter) SetCached(cached bool)

func (*BufferedWriter) Write added in v1.9.1

func (this *BufferedWriter) Write(b []byte) (int, error)

type Reader added in v1.9.1

type Reader interface {
	// Read reads content from underlying reader, and put it into an alloc.Buffer.
	Read() (*alloc.Buffer, error)
}

Reader extends io.Reader with alloc.Buffer.

type Writer added in v1.9.1

type Writer interface {
	// Write writes an alloc.Buffer into underlying writer.
	Write(*alloc.Buffer) error
}

Writer extends io.Writer with alloc.Buffer.

Jump to

Keyboard shortcuts

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