(Reuters) - Data storage company Western Digital Corp WDC.O reported higher-than-expected revenue and profit on Wednesday, helped by demand for its products amid stabilizing PC demand and a shift by businesses to cloud storage.

A Western Digital office building is shown in Irvine, California, U.S., January 24, 2017. REUTERS/Mike Blake

Western Digital has benefited from its shift to high-performance and cost-effective NAND flash drives, which is fast replacing the traditional magnetic storage method.

The company bought SanDisk in May to bolster its NAND flash technology.

Demand for the company’s cloud-based data storage products has also increased as businesses increasingly move to the cloud.

The Irvine, California-based company is also reaping rewards from royalty agreements. It signed agreement with Samsung Electronics Co Ltd 005930.KS last month for a semiconductor patent portfolio.

Excluding items, the company earned $2.30 per share, beating the average analyst estimate of $2.12 per share, according to Thomson Reuters I/B/E/S.

Rival Seagate Technology Plc STX.O reported a higher-than-expected profit on Tuesday and raised its revenue forecast for the current quarter, buoyed by strong demand for its cloud-based storage products.

Western Digital’s revenue rose to $4.89 billion in the second quarter ended Dec. 30 from $3.32 billion a year earlier. Analysts on an average had expected revenue of $4.76 billion.

The company’s net income, however, fell to $235 million, or 80 cents per share, from $251 million, or $1.07 per share, a year earlier.

Western Digital’s shares, which have gained more than 80 percent in the past year, were down 1.8 percent at $78.81 in after-market trading.