/// <inheritdoc />
        protected override byte[] ReadResponseData(INTV.Shared.Utility.ASCIIBinaryReader reader)
        {
            byte[] responseData   = new byte[ExpectedDataLength];
            var    bytesRemaining = ExpectedDataLength;
            var    chunkSize      = ReadChunkSize == 0 ? ExpectedDataLength : ReadChunkSize;

            DebugOutput("----------BEGINREAD buffer, expected: " + ExpectedDataLength + ", ChunkSize: " + chunkSize);

            var chunkNumber = 0;

            using (var memory = new System.IO.MemoryStream())
            {
                do
                {
                    var bytesToRead = (bytesRemaining / chunkSize) > 0 ? chunkSize : bytesRemaining;

                    DebugOutput("READING CHUNK # " + chunkNumber++ + ", numToRead: " + bytesToRead);

                    var dataRead = reader.ReadBytes(bytesToRead);

                    DebugOutput("WRITING to memory: " + bytesToRead + ", buff: " + dataRead.Length);

                    memory.Write(dataRead, 0, bytesToRead);
                    bytesRemaining -= bytesToRead;
                }while (bytesRemaining > 0);
                memory.Seek(0, System.IO.SeekOrigin.Begin);
                responseData = memory.ToArray();
            }

            DebugOutput("----------RETURNING buffer: " + responseData.Length + ", expected: " + ExpectedDataLength);

            return(responseData);
        }
 /// <inheritdoc />
 protected override byte[] ReadResponseData(INTV.Shared.Utility.ASCIIBinaryReader reader)
 {
     return(reader.ReadBytes(ErrorLog.FlatSizeInBytes));
 }
Exemple #3
0
 /// <inheritdoc />
 protected override byte[] ReadResponseData(INTV.Shared.Utility.ASCIIBinaryReader reader)
 {
     return(reader.ReadBytes(sizeof(uint)));
 }
Exemple #4
0
 /// <inheritdoc />
 protected override byte[] ReadResponseData(INTV.Shared.Utility.ASCIIBinaryReader reader)
 {
     return(reader.ReadBytes(FileSystemStatistics.FlatSizeInBytes));
 }