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

getLength

getLength(): Integer64;

The getLength method of the JadeBytes class returns the length allocated to the receiver for storage. This is either the actual length of the content if it was loaded directly by using a method such as appendData or loadFromFile, or the virtual length (how many bytes the receiver can contain) if it was specified using the allocate method.

The following example shows the use of the getLength method.

vars
    bytes : JadeBytes;
begin
    create bytes;
    bytes.allocate(1000000);
    write bytes.getLength;       // Writes 1000000
epilog
    delete bytes;
end;