示例#1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sizeMB">The file size in megabytes</param>
 /// <param name="count">The number of files</param>
 public Test(int sizeMB, int count)
 {
     SizeMB    = sizeMB;
     SizeBytes = Megabyte.ToBytes(sizeMB);
     Count     = count;
     m_helper  = new BlockHelper(this);
 }
示例#2
0
            /// <summary>
            /// Calculates the offset based on the given block index
            /// </summary>
            /// <param name="blockIndex"></param>
            internal void Update(int blockIndex)
            {
                BlockIndex = blockIndex;

                // Calculate the stream
                StreamIndex = (blockIndex / m_test.SizeMB);

                // Calculate the block index in the stream
                StreamBlockIndex = blockIndex - (StreamIndex * m_test.SizeMB);

                // Convert the block to bytes
                StreamOffset = Megabyte.ToBytes(StreamBlockIndex);
            }