func GenerateContent(reader io.ReadSeeker) (Content, error) {
	var sizer utils.SizeTracker
	sizingReader := io.TeeReader(reader, &sizer)
	fp, err := charmresource.GenerateFingerprint(sizingReader)
	if err != nil {
		return Content{}, errors.Trace(err)
	}
	if _, err := reader.Seek(0, os.SEEK_SET); err != nil {
		return Content{}, errors.Trace(err)
	}
	size := sizer.Size()

	content := Content{
		Data:        reader,
		Size:        size,
		Fingerprint: fp,
	}
	return content, nil
}
// GenerateContent returns a new Content for the given data stream.
GenerateContent returns a new Content for the given data stream.
// GenerateContent returns a new Content for the given data stream .
func GenerateContent(reader io.ReadSeeker) (Content, error) {
	var sizer utils.SizeTracker
	sizingReader := io.TeeReader(reader, &sizer)
	fp, err := charmresource.GenerateFingerprint(sizingReader)
	if err != nil {
		return Content{}, errors.Trace(err)
	}
	if _, err := reader.Seek(0, os.SEEK_SET); err != nil {
		return Content{}, errors.Trace(err)
	}
	size := sizer.Size()
	content := Content{
		Data:        reader,
		Size:        size,
		Fingerprint: fp,
	}
	return content, nil
}
func GenerateContent ( reader io . ReadSeeker ) ( Content , error ) { var sizer utils . SizeTracker sizingReader := io . TeeReader ( reader , & sizer ) fp , err := charmresource . GenerateFingerprint ( sizingReader ) if err != nil { return Content { } , errors . Trace ( err ) } if _ , err := reader . Seek ( 0 , os . SEEK_SET ) ; err != nil { return Content { } , errors . Trace ( err ) } size := sizer . Size ( ) content := Content { Data : reader , Size : size , Fingerprint : fp , } return content , nil }
GenerateContent returns a new Content for the given data stream.
GenerateContent returns a new Content for the given data stream .