ioutil.go at [2b049247ed]

File src/0dev.org/ioutil/ioutil.go artifact 404db9969d part of check-in 2b049247ed


// Package ioutil contains various constructs for io operations
package ioutil

// An function alias type that implements io.Writer
type WriterFunc func([]byte) (int, error)

// Delegates the call to the WriterFunc while implementing io.Writer
func (w WriterFunc) Write(b []byte) (int, error) {
	return w(b)
}

// An function alias type that implements io.Reader
type ReaderFunc func([]byte) (int, error)

// Delegates the call to the WriterFunc while implementing io.Reader
func (r ReaderFunc) Read(b []byte) (int, error) {
	return r(b)
}