Я обеспокоен тем, что этот код копирует байты во временный буфер перед записью непосредственно в файл.
Мне кажется, что должен быть какой-то метод копирования байтов непосредственно из хвостовой части основного буфера непосредственно в файл.
'this code copies all bytes starting at integer index from the main buffer into a new file: ga.exe
'declare temporary buffer
Dim EXEBytes(bytes.Count - index) As Byte
'copy subset of bytes over, starting at index
System.Buffer.BlockCopy(bytes, index, EXEBytes, 0, bytes.Count - index)
'write bytes from temporary array into file
File.WriteAllBytes(Server.MapPath("/BIN/ga.exe"), EXEBytes)
Есть идеи?