Fluxo múltiplo em um fluxo não será passado para o cliente corretamente

No serviço WCF, eu preencho o Stream de acordo comessa questão gostar :

   result.Stream = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(result.Stream);
            foreach (string fileN in zipFiles)
            {
                byte[] fileBytes = File.ReadAllBytes(fileN);
                writer.Write(BitConverter.GetBytes(fileBytes.Length), 0, 4);
                writer.Write(fileBytes, 0, fileBytes.Length);
            }
            writer.Flush();
            return result; 

antes disso eu estava retornando stream por isso e tudo funciona no serviço e no lado do cliente:

 result.Stream = new MemoryStream(File.ReadAllBytes(fileN));

Stream sejaMessageBodyMember mas o nut agora mudou para salvar todos os arquivos em um fluxo.

e método de teste no lado do cliente:

 ExportClient export = new ExportClient("exportEndPoint");
        ExportResult_C result = export.Export(source);
        result.Stream.Position = 0;
        //result.Stream.SaveToFile("d:\\kkk.log");
        BinaryReader reader = new BinaryReader(result.Stream, System.Text.Encoding.UTF8);
        string pathToSave = string.Empty;
        while (result.Stream.Position < result.Stream.Length)
        {
            int size = reader.ReadInt32();
            byte[] data = reader.ReadBytes(size);
            pathToSave = "D:\\test\\" + new Random().Next(0, 2564586).ToString() + ".zip";
            File.WriteAllBytes(pathToSave, data);
        }

o endereço do terminal:

 <endpoint address="net.tcp://localhost:2082/Exchange/Export.svc" binding="netTcpBinding" bindingConfiguration="largeSizeStreamTcp"
    contract="xxx" name="exportEndPoint"/>

e configuração de ligação:

 <netTcpBinding>
    <binding openTimeout="00:00:03" maxReceivedMessageSize="2000000000" transferMode="Streamed" maxBufferSize="2000000000" >
      <readerQuotas maxDepth="32" maxArrayLength="2000000000" maxStringContentLength="2000000000" />
      <security mode="None" />
    </binding>
    <binding name="largeSizeStreamTcp"  transferMode="Streamed" receiveTimeout="00:30:00" sendTimeout="00:30:00" openTimeout="00:00:01" maxReceivedMessageSize="2000000000" maxBufferSize="2000000000" >
      <readerQuotas maxDepth="32" maxArrayLength="2000000000" maxStringContentLength="2000000000" />
      <security mode="None" />
    </binding>
  </netTcpBinding>
  <netNamedPipeBinding>

Acredito que o endpoint e a ligação estejam corretos, pois consegui retornar um fluxo de arquivo e salvá-lo, mas agora não há problemas no lado do serviço, mas quando ele sai do lado do cliente, o Stream perdeu o conteúdo, o comprimento e a posição.

isso é realmente me leva até a parede !!!

alguém sabe por que isso ocorreu (no lado do cliente)?

questionAnswers(1)

yourAnswerToTheQuestion