Product Information > JADE Encyclopaedia of Classes – Volume 1 > Chapter 1 - System Classes > loadUsingFile

loadUsingFile

loadUsingFile(file: File) updating;

The loadUsingFile method of the JadeBytes class loads the binary content of the receiver using a File object specified by the file parameter. If the file specified by the file parameter is not open, an exception is raised.

This method is an alternative to the loadFromFile method, with the following additional functionality.

The following example shows the use of the loadFromFile method.

vars
    bytes : JadeBytes;
    file  : File;
begin
    create file;
    file.fileName := "c:\photo.jpg";
    file.open;
    create bytes;
    bytes.loadUsingFile(file);
epilog
    delete bytes;
    delete file;
end;