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: datapack_tlv_bigendian.go
    path of file: ./repos/zinx/zpack
    
    the code of the file until where you have to start completion: package zpack

import (
	"bytes"
	"encoding/binary"
	"errors"

	"github.com/aceld/zinx/zconf"
	"github.com/aceld/zinx/ziface"
)

var defaultHeaderLen uint32 = 8

type DataPack struct{}

// Ne
    
func (dp *DataPack) Pack(msg ziface.IMessage) ([]byte, error) {
	// Create a buffer to store the bytes
	// (创建一个存放bytes字节的缓冲)
	dataBuff := bytes.NewBuffer([]byte{})

	// Write the message ID
	if err := binary.Write(dataBuff, binary.BigEndian, msg.GetMsgID()); err != nil {
		return nil, err
	}

	// Write the data length
	if err := binary.Write(dataBuff, binary.BigEndian, msg.GetDataLen()); err != nil {
		return nil, err
	}

	// Write the data
	if err := binary.Write(dataBuff, binary.BigEndian, msg.GetData()); err != nil {
		return nil, err
	}

	return dataBuff.Bytes(), nil
}