nerdexam
Microsoft

98-372 · Question #114

Which class is a byte of data that reads and writes from and to a disk?

The correct answer is D. Stream class. A stream is a byte of data that reads and writes from and to a disk. The .NET Framework 2.0 provides the System.IO.Stream class as the base class for all the task- related stream data types. To read data in bytes is to transfer it from a stream into a data structure. To write…

Understanding Namespaces and Classes

Question

Which class is a byte of data that reads and writes from and to a disk?

Options

  • AStringReader class
  • BTextReader class
  • CXmlTextReader class
  • DStream class

How the community answered

(30 responses)
  • A
    7% (2)
  • B
    3% (1)
  • C
    20% (6)
  • D
    70% (21)

Explanation

A stream is a byte of data that reads and writes from and to a disk. The .NET Framework 2.0 provides the System.IO.Stream class as the base class for all the task- related stream data types. To read data in bytes is to transfer it from a stream into a data structure. To write data in bytes is to transfer it from a data structure into a stream. Streams support seeking, which queries and modifies the current position of data within a stream. Answer: A is incorrect. The StringReader class is used to implement a TextReader that reads from a string. It constructs and initializesa new instance of the StringReader class that reads from the specified string. It consists of the following methods: Read(char[], int, int) Answer: C is incorrect. The XmlTextReader class requires fast access to XML data. It does not require reading the entire document into memory via the Document Object Model (DOM). The class is derived from the XmlReader class and implements all the methods defined in the XmlReader class. The following are the functions of the XmlTextReader class: It enforces rules of a well-formed XML document. It does not provide any data validation in a document. It checks the Document Type Definition (DTD) and DocumentType nodes for their well- formed structure, but does not validate these nodes by using the DTD. Answer: B is incorrect. The TextReader class is used to provide a reader that can read a sequential chain of characters. It is the abstract base class of the StreamReader and StringReader classes. These derived classes can be used to open a text file for reading a specified range of characters, or to create a reader based on an existing stream. A derived class must at least implement the Peek and Read methods to make a functional instance of the TextReader class.

Topics

#Stream class#System.IO#byte data#file I/O

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice