Declaration: EncodeBase64 (InStream, OutStream: TStream; InsertCRLF: boolean);
The procedure EncodeBase64 encodes the data of the stream InStream into a base-64 encoded data stream OutStream. The encoding process starts at the current position of the input stream InStream and writes the resulting data to the current position of Outstream (overwriting all data after the current position). The parameter InsertCRLF controls whether the output stream is structured by <CR> (ASCII 13) and <LF> (ASCII 10) characters. If InsertCRLF is TRUE the encoded data stream is written as lines of 60 characters each.

Hint: BASE 64 encoded files are approx. 33% larger than the unencoded files.