Xceed Binary Encoding Library Documentation
Examples / Encoding from file to file (Delphi example)
In This Topic
    Encoding from file to file (Delphi example)
    In This Topic

    The first portion of code demonstrates encoding, the second demonstrates decoding.

    Delphi - Encoding Copy Code

    { This sample encodes with the Base64 format from file to file } 

    uses XceedBinaryEncodingLib_TLB 

    var
      xBinEncode : TXceedBinaryEncoding; 
      xBase64Format : XceedBase64EncodingFormat; 
      vaBytesRead : OleVariant; 
    begin
      xBinEncode := TXceedBinaryEncoding.Create( self ); 
      xBinEncode.License( 'your license key' ); 

      xBase64Format := CoXceedBase64EncodingFormat.Create(); 

      xBinEncode.EncodingFormat := xBase64Format; 

      try 
        xBinEncode.ProcessFile( 'c:\temp\source.txt', 0, 0, bfpEncode,
                                true, 'c:\temp\encoded.b64', false, vaBytesRead );  

        ShowMessage( 'Encoding successful!' ); 
      except 
        on xErr : Exception do 
          ShowMessage( xErr.Message ); 
      end; 

      xBinEncode.Free(); 
    end;