RawFile.read

From Spheriki

Jump to: navigation, search

Reads a number of bytes from a RawFile.


Contents

Usage

ByteArray rawfile.read(num_bytes);
  • rawfile Sphere RawFile object. The RawFile from which to read the bytes.
  • num_bytes number, positive. The number of bytes to read.
  • ByteArray is returned, holding num_bytes amount of data from the RawFile.


Examples

See the examples for RawFile.getSize().


Notes

  • The start of the data that is read is determined by a file pointer. This file pointer is automatically set to the end of data that is read by your Sphere game. The file pointer can be controlled using RawFile.getPosition() and RawFile.setPosition().
  • Any attempt to read more than what is stored in the file will simply return the remainder of the file.


See also

Personal tools