nerdexam
Microsoft

98-372 · Question #112

Which class is used to write primitive types in binary to a stream and supports writing strings in a specific encoding?

The correct answer is C. BinaryWriter class. The BinaryWriter class is used to write primitive types in binary to a stream and supports writing strings in a specific encoding. Any derived class can override the methods of the BinaryWriter class to give distinctive character encodings. Answer: A is incorrect. The…

Understanding Namespaces and Classes

Question

Which class is used to write primitive types in binary to a stream and supports writing strings in a specific encoding?

Options

  • ATextReader class
  • BBinaryReader class
  • CBinaryWriter class
  • DTextWriter class

How the community answered

(53 responses)
  • A
    4% (2)
  • B
    9% (5)
  • C
    81% (43)
  • D
    6% (3)

Explanation

The BinaryWriter class is used to write primitive types in binary to a stream and supports writing strings in a specific encoding. Any derived class can override the methods of the BinaryWriter class to give distinctive character encodings. Answer: A is incorrect. The TextReader class exposes a reader that can read a sequential series Answer: D is incorrect. The TextWriter class exposes a writer that can write a sequential series of Answer: B is incorrect. The BinaryReader class is used to read primitive data types as binary values in a specific encoding. Characters can be read from the stream using the given encoding system. The default encoding system is equal to New UTF8Encoding.

Topics

#BinaryWriter#System.IO#streams#binary data

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice