function CopyFrom(const Source: TStream; Count: Int64 = 0; BufferSize: Integer = $100000): Int64;
__int64 __fastcall CopyFrom(TStream* const Source, __int64 Count = 0LL, int BufferSize = 0x100000);
Copies a specified number of bytes from one stream to another.
CopyFrom copies Count bytes from the stream specified by Source into the stream. It then moves the current position by Count bytes and returns the number of bytes copied.
If Count is 0, CopyFrom sets Source position to 0 before reading and then copies the entire contents of Source into the stream. If Count is greater than or less than 0, CopyFrom reads from the current position in Source.
Because the CopyFrom method uses ReadBuffer and WriteBuffer to do the effective copying, if the Count is greater than the SourceStream size, ReadBuffer throws an exception stating that a stream read error has occured.