MAPIInspector.Parsers.FastTransferStream.ReadBlocks C# (CSharp) Метод

ReadBlocks() публичный Метод

Read a list of blocks and advance the position.
public ReadBlocks ( int totalSize, int blockSize ) : byte[][]
totalSize int The total number of bytes to read
blockSize int The size of each block
Результат byte[][]
        public byte[][] ReadBlocks(int totalSize, int blockSize)
        {
            int i;
            List<byte[]> l = new List<byte[]>();
            for (i = 0; i < totalSize; i += blockSize)
            {
                l.Add(this.ReadBlock(blockSize));
            }

            return l.ToArray();
        }

Usage Example

 /// <summary>
 /// Parse next object from a FastTransferStream.
 /// </summary>
 /// <param name="stream">A FastTransferStream</param>
 public override void Parse(FastTransferStream stream)
 {
     base.Parse(stream);
     PropertyDataType type = (PropertyDataType)this.PropType;
     this.Length = stream.ReadInt16();
     switch (type)
     {
         case PropertyDataType.PtypMultipleInteger16:
             this.FixedSizeValueList = stream.ReadBlocks(this.Length, 2);
             break;
         case PropertyDataType.PtypMultipleInteger32:
             this.FixedSizeValueList = stream.ReadBlocks(this.Length, 4);
             break;
         case PropertyDataType.PtypMultipleFloating32:
             this.FixedSizeValueList = stream.ReadBlocks(this.Length, 4);
             break;
         case PropertyDataType.PtypMultipleFloating64:
             this.FixedSizeValueList = stream.ReadBlocks(this.Length, 8);
             break;
         case PropertyDataType.PtypMultipleCurrency:
             this.FixedSizeValueList = stream.ReadBlocks(this.Length, 8);
             break;
         case PropertyDataType.PtypMultipleFloatingTime:
             this.FixedSizeValueList = stream.ReadBlocks(this.Length, 8);
             break;
         case PropertyDataType.PtypMultipleInteger64:
             this.FixedSizeValueList = stream.ReadBlocks(this.Length, 8);
             break;
         case PropertyDataType.PtypMultipleTime:
             this.FixedSizeValueList = stream.ReadBlocks(this.Length, 8);
             break;
         case PropertyDataType.PtypMultipleGuid:
             this.FixedSizeValueList = stream.ReadBlocks(this.Length, Guid.Empty.ToByteArray().Length);
             break;
         case PropertyDataType.PtypMultipleBinary:
             this.VarSizeValueList = stream.ReadLengthBlocks(this.Length);
             break;
         case PropertyDataType.PtypMultipleString:
             this.VarSizeValueList = stream.ReadLengthBlocks(this.Length);
             break;
         case PropertyDataType.PtypMultipleString8:
             this.VarSizeValueList = stream.ReadLengthBlocks(this.Length);
             break;
     }
 }