You need to write a code segment that transfers the contents of a byte array named dataToSend by using a NetworkStream object named netStream

You need to write a code segment that transfers the contents of a byte array named dataToSend
by using a NetworkStream object named netStream.  You need to use a cache of size 8,192
bytes. Which code segment should you use?


A. Dim memStream As New MemoryStream(8192)memStream.Write(dataToSend, 0, _
    CType(netStream.Length, Integer))
B. Dim memStream As New MemoryStream(8192)netStream.Write(dataToSend, 0, _
    CType(memStream.Length, Integer))
C. Dim bufStream As New BufferedStream(netStream, 8192)
    bufStream.Write(dataToSend, 0, dataToSend.Length)
D. Dim bufStream As New BufferedStream(netStream)
    bufStream.Write(dataToSend, 0, 8192)


Answer: C

No comments:

Post a Comment