ioutil.go at [2bcd5307ea]

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


// 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)
}