<FMLiveSwitchIFileStream> Protocol Reference

A file stream. More...

Instance Methods

(void) - close
 Closes the file stream. More...
 
(bool) - exists
 Returns a boolean value indicating whether the file exists. More...
 
(bool) - flush
 Flushes the file stream. More...
 
(long long) - length
 Gets the file stream length (must be opened first). More...
 
(void) - openWithAccess:
 Opens the file stream. More...
 
(NSString *) - path
 Gets the path. More...
 
(long long) - position
 Gets the position in the file stream. More...
 
(int) - readWithData:index:length:
 Reads data from the file stream. More...
 
(void) - setPosition:
 Sets the position in the file stream. More...
 
(bool) - writeToWithLocation:data:index:length:
 Writes data to the file stream. More...
 
(bool) - writeWithData:index:length:
 Writes data to the file stream. More...
 

Detailed Description

A file stream.

Method Documentation

◆ close

- (void) close

Closes the file stream.

◆ exists

- (bool) exists

Returns a boolean value indicating whether the file exists.

◆ flush

- (bool) flush

Flushes the file stream.

◆ length

- (long long) length

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

◆ openWithAccess:

- (void) openWithAccess: (FMLiveSwitchFileStreamAccess)  access

Opens the file stream.

Parameters
accessThe access requirement.

◆ path

- (NSString*) path

Gets the path.

◆ position

- (long long) position

Gets the position in the file stream.

◆ readWithData:index:length:

- (int) readWithData: (NSMutableData *)  data
index: (int)  index
length: (int)  length 

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.

◆ setPosition:

- (void) setPosition: (long long)  value

Sets the position in the file stream.

◆ writeToWithLocation:data:index:length:

- (bool) writeToWithLocation: (int)  location
data: (NSMutableData *)  data
index: (int)  index
length: (int)  length 

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.

◆ writeWithData:index:length:

- (bool) writeWithData: (NSMutableData *)  data
index: (int)  index
length: (int)  length 

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.