/// <summary>
        /// Deep copy constructor.
        /// </summary>
        public SmbTransPeekNmpipeSuccessResponsePacket(SmbTransPeekNmpipeSuccessResponsePacket packet)
            : base(packet)
        {
            this.InitDefaultValue();

            this.transParameters.ReadDataAvailable  = packet.transParameters.ReadDataAvailable;
            this.transParameters.MessageBytesLength = packet.transParameters.MessageBytesLength;
            this.transParameters.NamedPipeState     = packet.transParameters.NamedPipeState;

            if (packet.transData.ReadData != null)
            {
                this.transData.ReadData = new byte[packet.transData.ReadData.Length];
                Array.Copy(packet.transData.ReadData, this.transData.ReadData, packet.transData.ReadData.Length);
            }
            else
            {
                this.transData.ReadData = new byte[0];
            }
        }
        /// <summary>
        /// Deep copy constructor.
        /// </summary>
        public SmbTransPeekNmpipeSuccessResponsePacket(SmbTransPeekNmpipeSuccessResponsePacket packet)
            : base(packet)
        {
            this.InitDefaultValue();

            this.transParameters.ReadDataAvailable = packet.transParameters.ReadDataAvailable;
            this.transParameters.MessageBytesLength = packet.transParameters.MessageBytesLength;
            this.transParameters.NamedPipeState = packet.transParameters.NamedPipeState;

            if (packet.transData.ReadData != null)
            {
                this.transData.ReadData = new byte[packet.transData.ReadData.Length];
                Array.Copy(packet.transData.ReadData, this.transData.ReadData, packet.transData.ReadData.Length);
            }
            else
            {
                this.transData.ReadData = new byte[0];
            }
        }
        public SmbTransPeekNmpipeSuccessResponsePacket CreateTransPeekNmpipeSuccessResponse(
            CifsServerPerConnection connection,
            SmbTransPeekNmpipeRequestPacket request,
            ushort readDataAvailable,
            ushort messageBytesLength,
            SMB_NMPIPE_STATUS namedPipeState,
            byte[] readData)
        {
            readData = readData ?? new byte[0];
            SmbTransPeekNmpipeSuccessResponsePacket response = new SmbTransPeekNmpipeSuccessResponsePacket();
            response.SmbHeader = CifsMessageUtils.CreateSmbHeader(connection, request);

            TRANS_PEEK_NMPIPE_Response_Trans_Parameters transParameters = response.TransParameters;
            transParameters.ReadDataAvailable = readDataAvailable;
            transParameters.MessageBytesLength = messageBytesLength;
            transParameters.NamedPipeState = (ushort)namedPipeState;

            TRANS_PEEK_NMPIPE_Response_Trans_Data transData = response.TransData;
            transData.ReadData = readData;
            response.TransData = transData;

            response.UpdateCountAndOffset();

            return response;
        }