You need to serialize an object of type List(Of Integer) in a binary format. The object is named data. Which code segment should you use?

You need to serialize an object of type List(Of Integer) in a binary format. The object is named
data. Which code segment should you use?

A. Dim formatter As New BinaryFormatter()Dim ms As New
    MemoryStream()formatter.Serialize(ms, data)
B. Dim formatter As New BinaryFormatter()Dim ms As New MemoryStream() For i As
    Integer = 1 To 20
    formatter.Serialize(ms, data(i - 1))Next
C. Dim formatter As New BinaryFormatter()Dim buffer As New Byte(data.Count) {}Dim ms As
    New MemoryStream(buffer, True)formatter.Serialize(ms, data)
D. Dim formatter As New BinaryFormatter()Dim ms As New MemoryStream()While
    ms.CanRead formatter.Serialize(ms, data)End While\
 Answer: A 

No comments:

Post a Comment