fm.liveswitch.IFileStream Interface Reference

A file stream. More...

Public Member Functions

abstract void close ()
 Closes the file stream. More...
 
abstract boolean exists ()
 Returns a boolean value indicating whether the file exists. More...
 
abstract boolean flush ()
 Flushes the file stream. More...
 
abstract long getLength ()
 Gets the file stream length (must be opened first). More...
 
abstract String getPath ()
 Gets the path. More...
 
abstract long getPosition ()
 Gets the position in the file stream. More...
 
abstract void open (fm.liveswitch.FileStreamAccess access)
 Opens the file stream. More...
 
abstract int read (byte[] data, int index, int length)
 Reads data from the file stream. More...
 
abstract void setPosition (long value)
 Sets the position in the file stream. More...
 
abstract boolean write (byte[] data, int index, int length)
 Writes data to the file stream. More...
 
abstract boolean writeTo (int location, byte[] data, int index, int length)
 Writes data to the file stream. More...
 

Detailed Description

A file stream.

Member Function Documentation

◆ close()

abstract void fm.liveswitch.IFileStream.close ( )
abstract

Closes the file stream.

Implemented in fm.liveswitch.FileStream.

◆ exists()

abstract boolean fm.liveswitch.IFileStream.exists ( )
abstract

Returns a boolean value indicating whether the file exists.

Implemented in fm.liveswitch.FileStream.

◆ flush()

abstract boolean fm.liveswitch.IFileStream.flush ( )
abstract

Flushes the file stream.

Implemented in fm.liveswitch.FileStream.

◆ getLength()

abstract long fm.liveswitch.IFileStream.getLength ( )
abstract

Gets the file stream length (must be opened first).

Implemented in fm.liveswitch.FileStream.

◆ getPath()

abstract String fm.liveswitch.IFileStream.getPath ( )
abstract

Gets the path.

Implemented in fm.liveswitch.FileStream.

◆ getPosition()

abstract long fm.liveswitch.IFileStream.getPosition ( )
abstract

Gets the position in the file stream.

Implemented in fm.liveswitch.FileStream.

◆ open()

abstract void fm.liveswitch.IFileStream.open ( fm.liveswitch.FileStreamAccess  access)
abstract

Opens the file stream.

Parameters
accessThe access requirement.

◆ read()

abstract int fm.liveswitch.IFileStream.read ( byte[]  data,
int  index,
int  length 
)
abstract

Reads data from the file stream.

Parameters
dataThe buffer to fill with data from the file.
indexThe index at which to start writing.
lengthThe maximum number of bytes to read.
Returns
The number of bytes read from the file.

Implemented in fm.liveswitch.FileStream.

◆ setPosition()

abstract void fm.liveswitch.IFileStream.setPosition ( long  value)
abstract

Sets the position in the file stream.

Implemented in fm.liveswitch.FileStream.

◆ write()

abstract boolean fm.liveswitch.IFileStream.write ( byte[]  data,
int  index,
int  length 
)
abstract

Writes data to the file stream.

Parameters
dataThe data to write.
indexThe index at which to start reading.
lengthThe number of bytes to write.
Returns
true
if the data was written; otherwise,
false
.

Implemented in fm.liveswitch.FileStream.

◆ writeTo()

abstract boolean fm.liveswitch.IFileStream.writeTo ( int  location,
byte[]  data,
int  index,
int  length 
)
abstract

Writes data to the file stream.

Parameters
locationThe location to write to.
dataThe data to write to the file.
indexThe index at which to start reading.
lengthThe number of bytes to write.
Returns
true
if the data was written; otherwise,
false
.

Implemented in fm.liveswitch.FileStream.