I was following the example found here on serializing chunks of a large file. Somehow being new to serialization I am now lost as to what parameters to pass to my Serialize method. I have shelved the approach I was using yesterday because of the OOM exception. Will appreciate your help.
Public Shared Sub ReadAndProcessLargeFile(theFilename As String, ByVal obj As LocalDBObject, Optional whereToStartReading As Long = 0)
Dim bf As New BinaryFormatter() ' Create a binary formatter for this stream.
Using fileStram As New FileStream(theFilename, FileMode.Open, FileAccess.Read)
Dim buffer As Byte() = New Byte(fileStram.Length - 1) {}
fileStram.Seek(whereToStartReading, SeekOrigin.Begin)
Dim bytesRead As Integer = fileStram.Read(buffer, 0, buffer.Length)
While bytesRead > 0
bytesRead = fileStram.Read(buffer, 0, buffer.Length - 1)
'It is here where I am now lost. What parameters do I supply to my Serialize method below
bf.Serialize()
End While
End Using
End Sub