Please use http://golang.org/pkg/encoding/binary/#Write instead of doing this by hand.