func (ms *FileMessageSet) Append(other *MessageSet) error {
	n, err := other.WriteTo(ms.file)
	if err != nil {
		return err
	}
	ms.n += n
	ms.sr = io.NewSectionReader(ms.file, ms.pos, ms.n)
	return nil
}
Append adds other MessageSet to the end of this FileMessageSet.
package message
import (
	"encoding/binary"
	"errors"
	"fmt"
	"io"
	"os"
)
type FileMessageSet struct {
	file   *os.File
	sr     *io.SectionReader
	pos, n int64
}
var (
	ErrInvalid = errors.New("invalid file")
)
func NewFileMessageSet(f *os.File, pos, n int64) (*FileMessageSet, error) {
	if f == nil {
		return nil, ErrInvalid
	}
	if n == -1 {
		fi, err := f.Stat()
		if err != nil {
			return nil, err
		}
		n = fi.Size() - pos
	}
	return &FileMessageSet{
		file: f,
		sr:   io.NewSectionReader(f, pos, n),
		pos:  pos,
		n:    n,
	}, nil
}