Question:You need to serialize an object of type List<int> in a binary format.
The object is named data.
Which code segment should you use? - (VB.Net) 

A Dim formatter As New BinaryFormatter()
Dim stream As New MemoryStream()
formatter.Serialize(stream, data) 

B Dim formatter As New BinaryFormatter()
Dim stream As New MemoryStream()
For i As Integer = 0 To data.Count - 1
formatter.Serialize(stream, data(i))
Next 

C Dim formatter As New BinaryFormatter()
Dim buffer As Byte() = New Byte(data.Count - 1) {}
Dim stream As New MemoryStream(buffer, True)
formatter.Serialize(stream, data) 

D Dim formatter As New BinaryFormatter()
Dim stream As New MemoryStream()
data.ForEach(Function(num As Integer) Do
formatter.Serialize(stream, num)
End Function) 

+ Answer
+ Report
Total Preview: 1147

Copyright © 2024. Powered by Intellect Software Ltd