package bx

import (
	"bytes"
	"encoding/binary"
)

type CmdReadFileInfo struct {
	baseBxCmd
}

func NewCmdReadFileInfo() CmdReadFileInfo {
	return CmdReadFileInfo{
		baseBxCmd: newBaseCmd(CMD_GET_FILE_INTO.group, CMD_GET_FILE_INTO.code),
	}
}

func (cmd CmdReadFileInfo) Build() []byte {
	w := bytes.NewBuffer(make([]byte, 0, 8))
	binary.Write(w, binary.LittleEndian, cmd.Group())
	binary.Write(w, binary.LittleEndian, cmd.Cmd())
	binary.Write(w, binary.LittleEndian, cmd.ReqResp())
	binary.Write(w, binary.LittleEndian, []byte{0x00, 0x00})
	return nil
}
