package pgproto3

import (
	
	
	

	
)

type CopyOutResponse struct {
	OverallFormat     byte
	ColumnFormatCodes []uint16
}

func (*CopyOutResponse) () {}
Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message type identifier and 4 byte message length.
func ( *CopyOutResponse) ( []byte) error {
	 := bytes.NewBuffer()

	if .Len() < 3 {
		return &invalidMessageFormatErr{messageType: "CopyOutResponse"}
	}

	 := .Next(1)[0]

	 := int(binary.BigEndian.Uint16(.Next(2)))
	if .Len() != *2 {
		return &invalidMessageFormatErr{messageType: "CopyOutResponse"}
	}

	 := make([]uint16, )
	for  := 0;  < ; ++ {
		[] = binary.BigEndian.Uint16(.Next(2))
	}

	* = CopyOutResponse{OverallFormat: , ColumnFormatCodes: }

	return nil
}
Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length.
func ( *CopyOutResponse) ( []byte) []byte {
	 = append(, 'H')
	 := len()
	 = pgio.AppendInt32(, -1)

	 = append(, .OverallFormat)

	 = pgio.AppendUint16(, uint16(len(.ColumnFormatCodes)))
	for ,  := range .ColumnFormatCodes {
		 = pgio.AppendUint16(, )
	}

	pgio.SetInt32([:], int32(len([:])))

	return 
}
MarshalJSON implements encoding/json.Marshaler.
func ( CopyOutResponse) () ([]byte, error) {
	return json.Marshal(struct {
		              string
		 []uint16
	}{
		:              "CopyOutResponse",
		: .ColumnFormatCodes,
	})