Example #1
0
 private void PerformWrite(BufferedIO io)
 {
     try {
         // Perform the actual write
         _writer.Write(io.Files, io.Offset, io.buffer, 0, io.Count, io.PieceLength, io.Manager.Torrent.Size);
         _writeMonitor.AddDelta(io.Count);
     } finally {
         io.Complete = true;
         if (io.Callback != null)
         {
             io.Callback(true);
         }
     }
 }
Example #2
0
        private void PerformWrite(BufferedIO io)
        {
            // Find the block that this data belongs to and set it's state to "Written"
            int index = io.PieceOffset / Piece.BlockSize;

            try {
                // Perform the actual write
                writer.Write(io.Files, io.Offset, io.buffer, 0, io.Count, io.PieceLength, io.Manager.Torrent.Size);
                writeMonitor.AddDelta(io.Count);
            } finally {
                io.Complete = true;
                if (io.Callback != null)
                {
                    io.Callback(true);
                }
            }
        }