HOW TO USE FILE STREAM TO READ AND WRITE FILES OF SEVERAL HUNDRED MEGABYTES IN DELPHI?

Updated on technology 2024-03-30
5 answers
  1. Anonymous users2024-02-07

    I can't read your intentions, judging from the use of tdecompressionstream, it is to decompress something. Since it is decompressed, the number of bytes after DS decompresses the original file will not be the size of the original file, and the 9996 in sobeginning) is the size of the original file, or is it the size of the original file after decompression? If it's the size of the original file, then the positioning here is wrong.

  2. Anonymous users2024-02-06

    Open the file fopen("The path that needs to be opened")

    The row is then read using the fgets function.

    #include

    #include

    #include

    #define max_line 1024

    int main()

  3. Anonymous users2024-02-05

    The functions that can be referred to are fopen, fread, fwrite, and fclose

  4. Anonymous users2024-02-04

    Streams should be the same for the user, the user just uses the stream to save and output information, and the location of the medium in which it is stored is handled by the system, or it is up to you to manually code and choose.

    Memory streams are obviously faster than file streams, but file streams are obviously larger in capacity than memory streams.

  5. Anonymous users2024-02-03

    Is buffer1 defined as an array or a pointer? Or integer?

    If it is an integer, the length is 4 bytes, more than 4 bytes, of course, there is an error, if there is more data, you can define an array, and then read the buffer1:array[1... in the array4096] of integer;4096 integers can be read.

    m:=;tmemorystream(m).loadfromfile(;

    sizeof(buffer1));

    However, if you are using a memory stream, you can also directly manipulate its pointer buffer1:pinteger;

    m:=;tmemorystream(m).loadfromfile(;

    buffer1:=;

    for i:=0 to div sizeof(integer) do

    beginbuffer1 is the integer number.

    inc(buffer1);

    end;

Related questions
23 answers2024-03-30

Please modify it yourself as needed.

procedure addlink; >>>More

10 answers2024-03-30

Random numbers in pascal.

Random numbers refer to a series of numbers that theoretically have no rules to follow, have an equal probability of each number appearing within a specified range, and cannot be used to follow the previous number. The basic principle of a general random number generator is: first, initialize a random seed, the initial value of which can be an arbitrary integer; Every time a random number is obtained, a special operation is performed based on the random seed, a random number is obtained and returned, and then some operation is performed on the random seed to change the value of the random seed. >>>More

5 answers2024-03-30

procedure : tobject);

vararr:array of array of string; >>>More

6 answers2024-03-30

Connecting oracle's stored procedure with Delphi's tadostoreprocedure works executable, I've used it a few times, it's just that my stored procedure is written in the middle of the three layers, and I don't return a dataset. >>>More

14 answers2024-03-30

function getsqlserverlist(strings:tstrings):boolean;

The function is implemented as follows: >>>More