You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: scanner_tar.go
    path of file: ./repos/benthos/internal/impl/pure
    
    the code of the file until where you have to start completion: package pure

import (
	"archive/tar"
	"bytes"
	"context"
	"io"

	"github.com/benthosdev/benthos/v4/public/service"
)

func t
    
func (c *tarScanner) NextBatch(ctx context.Context) (service.MessageBatch, error) {
	if c.r == nil {
		return nil, io.EOF
	}

	hdr, err := c.t.Next()
	if err != nil {
		return nil, err
	}

	var buf bytes.Buffer
	if _, err := io.Copy(&buf, c.t); err != nil {
		return nil, err
	}

	msg := service.NewMessage(buf.Bytes())
	msg.MetaSetMut("tar_name", hdr.Name)

	return service.MessageBatch{msg}, nil
}