Re: file transfer with sockets



On Wed, 16 May 2007 09:42:23 -0700, Nicholas Paldino [.NET/C# MVP] <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

[...]
You could load the entire contents of the file into one big byte array, but that wouldn't be too efficient, and would gobble up memory
for large files (hence the reading in chunks).

And of course would not even work for files too large to fit in the process's address space. :)
.



Relevant Pages

  • Re: fast stable sort
    ... For fastest load, at expense of slower sort, you ask the operating ... and you memory-map the file directly into that array. ... memory of your big array. ... possible to assure locality of reference and thus avoid thrashing ...
    (comp.programming)
  • Re: dealing with a time series piece wise (with gaps)
    ... You do not mention the size of the text file, if its small enough to fit in memory, using LOAD and then working off the data in memory might be faster than: ... However, since you will not know how much data to expect in a segment you will not be able to pre-allocate, this might slow your code. ... store this piece of triplet array (time, ...
    (comp.soft-sys.matlab)
  • Re: seeking thru a file
    ... Mag Gam wrote: ... I want to load the first 100 lines into an array. ... from memory ...
    (comp.lang.python)
  • Re: Save an array to memory for another program to read it
    ... I need the program to store into memory this array, end itself and when immediately runs again to load this array again from the memory. ...
    (comp.lang.fortran)
  • Re: remoting for file transfer
    ... going to have to load the contents of the file into a byte array in memory and then transmit it. ...
    (microsoft.public.dotnet.languages.csharp)