98-372 · Question #47
Which class reads and writes a stream of data in bytes to a memory instead of a disk?
The correct answer is D. MemoryStream class. The MemoryStream class is contained in the System.IO namespace. It inherits the Stream class. It reads and writes a stream of data in bytes to a memory instead of a disk. It stores data as an unsigned byte array, which is initialized when a MemoryStream object is created. An adva
Question
Which class reads and writes a stream of data in bytes to a memory instead of a disk?
Options
- AStorageStream class
- BDiskStream class
- CNetworkStream class
- DMemoryStream class
How the community answered
(43 responses)- A5% (2)
- B12% (5)
- C2% (1)
- D81% (35)
Explanation
The MemoryStream class is contained in the System.IO namespace. It inherits the Stream class. It reads and writes a stream of data in bytes to a memory instead of a disk. It stores data as an unsigned byte array, which is initialized when a MemoryStream object is created. An advantage of the MemoryStream class is that it saves data storage in buffers and files. Answer: C is incorrect. The NetworkStream class provides methods for sending and receiving data over Stream sockets in blocking mode. It can be used for both synchronous as well as asynchronous data transfer. This class does not support random access to the network data stream. However, read and write operations can be executed at the same time on a NetworkStream class instance without the need for synchronization. Answer: A and B are incorrect. There is no such class as StorageStream or DiskStream in the .NET Framework.
Topics
Community Discussion
No community discussion yet for this question.