Core\FileTransfer\Chunks
The content of a file in chunks of at most 64 KiB, which readStream returns. Use it in a foreach loop. Each step reads one chunk.
Core\FileTransfer\Chunks is the content of one file on a server, in parts. Core\FileTransfer\Connection::readStream returns it. You read it with a foreach loop. Each chunk is a bytes value of at most 64 KiB. The value is tainted. This means it comes from the server, and some methods do not accept it until your program checks it. The whole file is never in memory at once.
The loop downloads one chunk in each step. You can also pass the chunks to a method that takes chunks, such as Core\IO::writeStream, Core\Hash::of or the write method of another connection.
Over FTP and FTPS, the connection can do one thing at a time. A call on the same connection during the loop ends the download. Then the next step of the loop throws an IOError. Over SFTP, the connection can do other calls during the loop.
Returned by
You get a Core\FileTransfer\Chunks from these methods:
