RawFile.getSize

From Spheriki

Jump to: navigation, search

Get the size of a RawFile in bytes.


Contents

Usage

number rawfile.getSize();
  • rawfile Sphere RawFile object. The file to get the size of.
  • number' is returned, which is the number of bytes in the file.


Examples

The following example shows how to easily read in the whole of a small text file into a string. Make sure other/test.txt exists first:

var rf = OpenRawFile("test.txt");
var ba = rf.read(rf.getSize());
var str = CreateStringFromByteArray(ba);


Notes

  • This function can be used together with others to easily read in the whole of a small text file, as shown in the example above.


See also

Personal tools