Drag[en]gine Script Module DragonScript  1.21
Dragengine.FileReader Class Reference

File reader. More...

Inheritance diagram for Dragengine.FileReader:

Public Member Functions

Management
String getFilename ()
 File name. More...
 
int getLength ()
 File size in bytes. More...
 
int getPosition ()
 Current reading position in bytes from the beginning of the file. More...
 
void setPosition (int position)
 Set reading file position in bytes relative to beginning of file. More...
 
void movePosition (int offset)
 Move reading file position by offset in bytes. More...
 
void setPositionEnd (int position)
 Set reading file position in bytes relative to end of file. More...
 
int getStreamVersion ()
 Stream version used by readFromFile of native classes. More...
 
void setStreamVersion (int version)
 Set stream version used by readFromFile of native classes. More...
 
bool eof ()
 File reading pointer is at the end of file. More...
 
int readChar ()
 Read one byte (1 byte) and advance the file reading position. More...
 
int readByte ()
 Read one unsigned byte (1 byte) and advance the file reading position. More...
 
int readShort ()
 Read one short (2 bytes) and advance the file reading position. More...
 
int readUShort ()
 Read one unsigned short (2 bytes) and advance the file reading position. More...
 
int readInt ()
 Read one int (4 bytes) and advance the file reading position. More...
 
int readUInt ()
 Read one unsigned int (4 bytes) and advance the file reading position. More...
 
float readFloat ()
 Read one float (4 bytes) and advance the file reading position. More...
 
String readString8 ()
 Read string prefixed by a 1-byte length field and advance the file reading position. More...
 
String readString16 ()
 Read string prefixed by a 2-byte2 length field and advance the file reading position. More...
 
String readString (int size)
 Read string without length field and advance the file reading position. More...
 
void skipString8 ()
 Skips string prefixed by a 1-byte length field and advance the file reading position. More...
 
void skipString16 ()
 Skips string prefixed by a 2-byte2 length field and advance the file reading position. More...
 
TimeDate readTimeDate ()
 Read TimeDate instance. More...
 

Constructors

FileReader new (String filename)
 Create file reader reading from virtual file system file. More...
 
static FileReader newZCompressed (String filename)
 Create Z-Decompressing file reader reading from virtual file system file. More...
 

Detailed Description

File reader.

This is a native class.

Member Function Documentation

◆ eof()

bool Dragengine.FileReader.eof ( )

File reading pointer is at the end of file.

◆ getFilename()

String Dragengine.FileReader.getFilename ( )

File name.

◆ getLength()

int Dragengine.FileReader.getLength ( )

File size in bytes.

◆ getPosition()

int Dragengine.FileReader.getPosition ( )

Current reading position in bytes from the beginning of the file.

◆ getStreamVersion()

int Dragengine.FileReader.getStreamVersion ( )

Stream version used by readFromFile of native classes.

◆ movePosition()

void Dragengine.FileReader.movePosition ( int  offset)

Move reading file position by offset in bytes.

◆ new()

FileReader Dragengine.FileReader.new ( String  filename)

Create file reader reading from virtual file system file.

◆ newZCompressed()

static FileReader Dragengine.FileReader.newZCompressed ( String  filename)
static

Create Z-Decompressing file reader reading from virtual file system file.

Version
1.8

◆ readByte()

int Dragengine.FileReader.readByte ( )

Read one unsigned byte (1 byte) and advance the file reading position.

◆ readChar()

int Dragengine.FileReader.readChar ( )

Read one byte (1 byte) and advance the file reading position.

◆ readFloat()

float Dragengine.FileReader.readFloat ( )

Read one float (4 bytes) and advance the file reading position.

◆ readInt()

int Dragengine.FileReader.readInt ( )

Read one int (4 bytes) and advance the file reading position.

◆ readShort()

int Dragengine.FileReader.readShort ( )

Read one short (2 bytes) and advance the file reading position.

◆ readString()

String Dragengine.FileReader.readString ( int  size)

Read string without length field and advance the file reading position.

◆ readString16()

String Dragengine.FileReader.readString16 ( )

Read string prefixed by a 2-byte2 length field and advance the file reading position.

◆ readString8()

String Dragengine.FileReader.readString8 ( )

Read string prefixed by a 1-byte length field and advance the file reading position.

◆ readTimeDate()

TimeDate Dragengine.FileReader.readTimeDate ( )

Read TimeDate instance.

◆ readUInt()

int Dragengine.FileReader.readUInt ( )

Read one unsigned int (4 bytes) and advance the file reading position.

◆ readUShort()

int Dragengine.FileReader.readUShort ( )

Read one unsigned short (2 bytes) and advance the file reading position.

◆ setPosition()

void Dragengine.FileReader.setPosition ( int  position)

Set reading file position in bytes relative to beginning of file.

◆ setPositionEnd()

void Dragengine.FileReader.setPositionEnd ( int  position)

Set reading file position in bytes relative to end of file.

◆ setStreamVersion()

void Dragengine.FileReader.setStreamVersion ( int  version)

Set stream version used by readFromFile of native classes.

◆ skipString16()

void Dragengine.FileReader.skipString16 ( )

Skips string prefixed by a 2-byte2 length field and advance the file reading position.

◆ skipString8()

void Dragengine.FileReader.skipString8 ( )

Skips string prefixed by a 1-byte length field and advance the file reading position.


The documentation for this class was generated from the following file: