Hello,
I have to proccess big files (around 4GB) and to prevent Out of Memory exceptions I am splitting the file in 256MB blocks. The problem is, as I have to create the file sequencially (block by block), I dont know how to "stick"/"concatenat e" the remaining pieces to the last one (or first processed).
I have to "add" the rest of the bytes to the file, anyone knows if this is possible? I am using FileStream and BinaryWriter to do it.
For example, to read I can do this:
[PHP]
Dim BInput As New FileStream(File name, FileMode.Open, FileAccess.Read )
Dim Reader As New BinaryReader(BI nput)
'then inside a loop with variable k:
Reader.Read(myd ata, k * Dtblock, Dtblock)
'loop end[/PHP]
(where Dtblock is a constant that indicates 256MB.)
but then I dont know the oposite of the instructions above (to write)
thanks in advance!
I have to proccess big files (around 4GB) and to prevent Out of Memory exceptions I am splitting the file in 256MB blocks. The problem is, as I have to create the file sequencially (block by block), I dont know how to "stick"/"concatenat e" the remaining pieces to the last one (or first processed).
I have to "add" the rest of the bytes to the file, anyone knows if this is possible? I am using FileStream and BinaryWriter to do it.
For example, to read I can do this:
[PHP]
Dim BInput As New FileStream(File name, FileMode.Open, FileAccess.Read )
Dim Reader As New BinaryReader(BI nput)
'then inside a loop with variable k:
Reader.Read(myd ata, k * Dtblock, Dtblock)
'loop end[/PHP]
(where Dtblock is a constant that indicates 256MB.)
but then I dont know the oposite of the instructions above (to write)
thanks in advance!
Comment