func newHook(source, hook io.Reader) io.Reader {
	if hook == nil {
		return source
	}
	return &hookReader{source, hook}
}
newHook returns a io.ReadSeeker which implements hookReader that
reports the data read from the source to the hook.
package minio
import (
	"fmt"
	"io"
)
type hookReader struct {
	source io.Reader
	hook   io.Reader
}
func (hr *hookReader) Seek(offset int64, whence int) (n int64, err error) {
	sourceSeeker, ok := hr.source.(io.Seeker)
	if ok {
		n, err = sourceSeeker.Seek(offset, whence)
		if err != nil {
			return 0, err
		}
	}
	hookSeeker, ok := hr.hook.(io.Seeker)
	if ok {
		var m int64
		m, err = hookSeeker.Seek(offset, whence)
		if err != nil {
			return 0, err
		}
		if n != m {
			return 0, fmt.Errorf("hook seeker seeked %d bytes, expected source %d bytes", m, n)
		}
	}
	return n, nil
}
func (hr *hookReader) Read(b []byte) (n int, err error) {
	n, err = hr.source.Read(b)
	if err != nil && err != io.EOF {
		return n, err
	}
	if _, herr := hr.hook.Read(b[:n]); herr != nil {
		if herr != io.EOF {
			return n, herr
		}
	}
	return n, err
}