BxCmdFileRead.go 556 B

12345678910111213141516171819202122232425
  1. package bx
  2. import (
  3. "bytes"
  4. "encoding/binary"
  5. )
  6. type CmdReadFileInfo struct {
  7. baseBxCmd
  8. }
  9. func NewCmdReadFileInfo() CmdReadFileInfo {
  10. return CmdReadFileInfo{
  11. baseBxCmd: newBaseCmd(CMD_GET_FILE_INTO.group, CMD_GET_FILE_INTO.code),
  12. }
  13. }
  14. func (cmd CmdReadFileInfo) Build() []byte {
  15. w := bytes.NewBuffer(make([]byte, 0, 8))
  16. binary.Write(w, binary.LittleEndian, cmd.Group())
  17. binary.Write(w, binary.LittleEndian, cmd.Cmd())
  18. binary.Write(w, binary.LittleEndian, cmd.ReqResp())
  19. binary.Write(w, binary.LittleEndian, []byte{0x00, 0x00})
  20. return nil
  21. }