// UnWrap unwraps a reader returning unwrapped and wrap, a function to
// wrap it back up again.  If `in` is an Accounter then this function
// will take the accounting unwrapped and wrap will put it back on
// again the new Reader passed in.
//
// This allows functions which wrap io.Readers to move the accounting
// to the end of the wrapped chain of readers.  This is very important
// if buffering is being introduced and if the Reader might be wrapped
// again.
UnWrap unwraps a reader returning unwrapped and wrap, a function to
wrap it back up again.  If `in` is an Accounter then this function
will take the accounting unwrapped and wrap will put it back on
again the new Reader passed in.

This allows functions which wrap io.Readers to move the accounting
to the end of the wrapped chain of readers.  This is very important
if buffering is being introduced and if the Reader might be wrapped
again.
// UnWrap unwraps a reader returning unwrapped and wrap a function to // wrap it back up again . If ` in ` is an Accounter then this function // will take the accounting unwrapped and wrap will put it back on // again the new Reader passed in . // // This allows functions which wrap io . Readers to move the accounting // to the end of the wrapped chain of readers . This is very important // if buffering is being introduced and if the Reader might be wrapped // again .
func UnWrap(in io.Reader) (unwrapped io.Reader, wrap WrapFn) {
	acc, ok := in.(Accounter)
	if !ok {
		return in, func(r io.Reader) io.Reader { return r }
	}
	return acc.OldStream(), acc.WrapStream
}
func UnWrap ( in io . Reader ) ( unwrapped io . Reader , wrap WrapFn ) { acc , ok := in . ( Accounter ) if ! ok { return in , func ( r io . Reader ) io . Reader { return r } } return acc . OldStream ( ) , acc . WrapStream }
UnWrap unwraps a reader returning unwrapped and wrap, a function to
wrap it back up again.
UnWrap unwraps a reader returning unwrapped and wrap a function to wrap it back up again .