/// <summary> /// Parse the RopFastTransferSourceGetBufferResponse structure. /// </summary> /// <param name="s">An stream containing RopFastTransferSourceGetBufferResponse structure.</param> public override void Parse(Stream s) { base.Parse(s); this.RopId = (RopIdType)ReadByte(); this.InputHandleIndex = ReadByte(); HelpMethod help = new HelpMethod(); this.ReturnValue = help.FormatErrorCode(ReadUint()); if ((ErrorCodes)ReturnValue == ErrorCodes.Success) { this.TransferStatus = (TransferStatus)ReadUshort(); this.InProgressCount = ReadUshort(); this.TotalStepCount = ReadUshort(); this.Reserved = ReadByte(); this.TransferBufferSize = ReadUshort(); byte[] Buffer = ReadBytes((int)this.TransferBufferSize); FastTransferStream TransferStream = new FastTransferStream(Buffer, true); switch (DecodingContext.StreamType_Getbuffer) { case FastTransferStreamType.TopFolder: this.TransferBuffer = new TopFolder(TransferStream); break; case FastTransferStreamType.contentsSync: this.TransferBuffer = new ContentsSync(TransferStream); break; case FastTransferStreamType.hierarchySync: this.TransferBuffer = new HierarchySync(TransferStream); break; case FastTransferStreamType.state: this.TransferBuffer = new State(TransferStream); break; case FastTransferStreamType.folderContent: this.TransferBuffer = new FolderContent(TransferStream); break; case FastTransferStreamType.MessageContent: this.TransferBuffer = new MessageContent(TransferStream); break; case FastTransferStreamType.attachmentContent: this.TransferBuffer = new AttachmentContent(TransferStream); break; case FastTransferStreamType.MessageList: this.TransferBuffer = new MessageList(TransferStream); break; default: throw new Exception("The transferStream type is not right"); } } if ((AdditionalErrorCodes)ReturnValue == AdditionalErrorCodes.ServerBusy) { this.BackoffTime = ReadUint(); } }
/// <summary> /// Parse the RopFastTransferDestinationPutBufferRequest structure. /// </summary> /// <param name="s">An stream containing RopFastTransferDestinationPutBufferRequest structure.</param> public override void Parse(Stream s) { base.Parse(s); this.RopId = (RopIdType)ReadByte(); this.LogonId = ReadByte(); this.InputHandleIndex = ReadByte(); this.TransferDataSize = ReadUshort(); byte[] Buffer = ReadBytes((int)this.TransferDataSize); FastTransferStream TransferStream = new FastTransferStream(Buffer, true); switch (DecodingContext.StreamType_Putbuffer) { case FastTransferStreamType.TopFolder: this.TransferData = new TopFolder(TransferStream); break; case FastTransferStreamType.folderContent: this.TransferData = new FolderContent(TransferStream); break; case FastTransferStreamType.MessageContent: this.TransferData = new MessageContent(TransferStream); break; case FastTransferStreamType.attachmentContent: this.TransferData = new AttachmentContent(TransferStream); break; case FastTransferStreamType.MessageList: this.TransferData = new MessageList(TransferStream); break; default: throw new Exception("The transferStream type is not right"); } }