public RepositoryViewWriteRoutine(RepositoryViewCache cache, int piece, int block, FileBuffer buffer, RepositoryViewWriteCallback callback) { this.piece = piece; this.block = block; this.buffer = buffer; this.callback = callback; this.entries = cache.Find(piece, block, 1); this.offset = piece * (long)cache.PieceSize + block * cache.BlockSize; }
public void Write(FileBuffer buffer, int piece, int block, RepositoryViewWriteCallback callback) { new RepositoryViewWriteRoutine(cache, piece, block, buffer, callback).Execute(); }