コード例 #1
0
        public void FillFirstBuffer()
        {
            // Write 4 blocks to the stream and then verify they can all be read
            for (int i = 0; i < 4; i++)
            {
                Initialise(buffer, (byte)(i + 1));
                level1.Write(singleFile, Piece.BlockSize * i, buffer, 0, buffer.Length);
            }

            // Read them all back out and verify them
            for (int i = 0; i < 4; i++)
            {
                level1.Read(singleFile, Piece.BlockSize * i, buffer, 0, Piece.BlockSize);
                Verify(buffer, (byte)(i + 1));
            }
        }