/// <summary>
        /// decode the batched request packet
        /// </summary>
        /// <param name="channel">the channel of bytes to read</param>
        /// <param name="request">the request of the response.</param>
        /// <param name="smbBatchedResponse">the batched response</param>
        /// <returns>the consumed length of batched response packet</returns>
        protected virtual int DecodeBatchedRequest(
            Channel channel,
            SmbPacket request, SmbBatchedResponsePacket smbBatchedResponse)
        {
            int batchedConsumedLength = 0;

            batchedConsumedLength += smbBatchedResponse.ReadAndxFromChannel(request, channel);

            return(batchedConsumedLength);
        }
        /// <summary>
        /// to read the andx packet from the channel
        /// </summary>
        /// <param name="smbRequest">the request of the response.</param>
        /// <param name="channel">the channel started with the SmbParameters of the andx.</param>
        /// <returns>the size in bytes of the SmbParameters, SmbData and andx if existed of the andx.</returns>
        internal int ReadAndxFromChannel(SmbPacket smbRequest, Channel channel)
        {
            int consumedLen = 0;

            if (this.AndxCommand != SmbCommand.SMB_COM_NO_ANDX_COMMAND)
            {
                SmbHeader andxHeader = this.SmbHeader;
                andxHeader.Command        = this.AndxCommand;
                andxHeader.Protocol       = CifsMessageUtils.SMB_PROTOCOL_ANDXPACKET;
                this.andxPacket           = CifsMessageUtils.CreateSmbResponsePacket(smbRequest, andxHeader, channel);
                this.andxPacket.SmbHeader = andxHeader;
                consumedLen += this.andxPacket.ReadParametersFromChannel(channel);
                consumedLen += this.andxPacket.ReadDataFromChannel(channel);
                SmbBatchedResponsePacket batchedResponse = this.andxPacket as SmbBatchedResponsePacket;
                if (batchedResponse != null)
                {
                    consumedLen += batchedResponse.ReadAndxFromChannel(smbRequest, channel);
                }
            }
            return(consumedLen);
        }
        /// <summary>
        /// decode the batched request packet
        /// </summary>
        /// <param name="channel">the channel of bytes to read</param>
        /// <param name="request">the request of the response.</param>
        /// <param name="smbBatchedResponse">the batched response</param>
        /// <returns>the consumed length of batched response packet</returns>
        protected virtual int DecodeBatchedRequest(
            Channel channel,
            SmbPacket request, SmbBatchedResponsePacket smbBatchedResponse)
        {
            int batchedConsumedLength = 0;

            batchedConsumedLength += smbBatchedResponse.ReadAndxFromChannel(request, channel);

            return batchedConsumedLength;
        }