E.g.
vb.net Code:
Private Sub CopyFile(ByVal sourcePath As String, _
ByVal destinationPath As String, _
ByVal blockSize As Integer)
Using source As New IO.FileStream(sourcePath, IO.FileMode.Open)
Using destination As New IO.FileStream(destinationPath, IO.FileMode.Create)
Dim buffer(blockSize - 1) As Byte
Dim byteCount As Integer = source.Read(buffer, 0, blockSize)
While byteCount > 0
destination.Write(buffer, 0, byteCount)
byteCount = source.Read(buffer, 0, blockSize)
End While
End Using
End Using
End Sub