func (aw *Writer) WriteHeader(hdr *Header) error {
	aw.nb = int64(hdr.Size)
	header := make([]byte, HEADER_BYTE_SIZE)
	s := slicer(header)
	aw.string(s.next(16), hdr.Name)
	aw.numeric(s.next(12), hdr.ModTime.Unix())
	aw.numeric(s.next(6), int64(hdr.Uid))
	aw.numeric(s.next(6), int64(hdr.Gid))
	aw.octal(s.next(8), hdr.Mode)
	aw.numeric(s.next(10), hdr.Size)
	aw.string(s.next(2), "`\n")
	_, err := aw.w.Write(header)
	return err
}
Writes the header to the underlying writer and prepares
to receive the file payload
package ar
import (
	"errors"
	"io"
	"strconv"
)
var (
	ErrWriteTooLong    = errors.New("ar: write too long")
)
type Writer struct {
	w io.Writer
	nb int64  
}
func NewWriter(w io.Writer) *Writer { return &Writer{w: w} }
func (aw *Writer) numeric(b []byte, x int64) {
	s := strconv.FormatInt(x, 10)
	for len(s) < len(b) {
		s = s + " "
	}
	copy(b, []byte(s))
}
func (aw *Writer) octal(b []byte, x int64) {
	s := "100" + strconv.FormatInt(x, 8)
	for len(s) < len(b) {
		s = s + " "
	}
	copy(b, []byte(s))
}
func (aw *Writer) string(b []byte, str string) {
	s := str
	for len(s) < len(b) {
		s = s + " "
	}
	copy(b, []byte(s))
}
func (aw *Writer) Write(b []byte) (n int, err error) {
	if int64(len(b)) > aw.nb {
		b = b[0:aw.nb]
		err = ErrWriteTooLong
	}
	n, werr := aw.w.Write(b)
	aw.nb -= int64(n)
	if werr != nil {
		return n, werr
	}
	if len(b)%2 == 1 {  
		n2, _ := aw.w.Write([]byte{'\n'})
		return n+n2, err
	}
	return
}
func (aw *Writer) WriteGlobalHeader() error {
	_, err := aw.w.Write([]byte(GLOBAL_HEADER))
	return err
}