AbstractFile
in package
implements
FileInterface
Tags
Table of Contents
Interfaces
Methods
- readBinary() : string
- Reads binary data from the current position in the file and advances the file pointer.
- readByte() : int
- Reads a byte from the current position in the file and advances the file pointer.
- readBytes() : string
- Read num bytes from the current position in the file and advances the file pointer.
- readInt() : int
- Reads an integer from the current position in the file and advances the file pointer.
- readLong() : int|float
- Returns a long integer from the current position in the file and advances the file pointer.
- readString() : string
- Reads a string from the current position in the file and advances the file pointer.
- readVInt() : int
- Returns a variable-length integer from the current position in the file and advances the file pointer.
- writeByte() : mixed
- Writes a byte to the end of the file.
- writeBytes() : void
- Writes num bytes of data (all, if $num===null) to the end of the string.
- writeInt() : void
- Writes an integer to the end of file.
- writeLong() : void
- Writes long integer to the end of file
- writeString() : void
- Writes a string to the end of file.
- writeVInt() : void
- Writes a variable-length integer to the end of file.
- _readLong32Bit() : int|float
- Returns a long integer from the current position in the file, advances the file pointer and return it as float (for 32-bit platforms).
- _writeLong32Bit() : void
- Writes long integer to the end of file (32-bit platforms implementation)
- fread() : string
- fwrite() : void
Methods
readBinary()
Reads binary data from the current position in the file and advances the file pointer.
public
readBinary() : string
Return values
stringreadByte()
Reads a byte from the current position in the file and advances the file pointer.
public
readByte() : int
Return values
intreadBytes()
Read num bytes from the current position in the file and advances the file pointer.
public
readBytes(int $num) : string
Parameters
- $num : int
Return values
stringreadInt()
Reads an integer from the current position in the file and advances the file pointer.
public
readInt() : int
Return values
intreadLong()
Returns a long integer from the current position in the file and advances the file pointer.
public
readLong() : int|float
Return values
int|floatreadString()
Reads a string from the current position in the file and advances the file pointer.
public
readString() : string
Return values
stringreadVInt()
Returns a variable-length integer from the current position in the file and advances the file pointer.
public
readVInt() : int
Return values
intwriteByte()
Writes a byte to the end of the file.
public
writeByte(int $byte) : mixed
Parameters
- $byte : int
writeBytes()
Writes num bytes of data (all, if $num===null) to the end of the string.
public
writeBytes(string $data[, int $num = null ]) : void
Parameters
- $data : string
- $num : int = null
writeInt()
Writes an integer to the end of file.
public
writeInt(int $value) : void
Parameters
- $value : int
writeLong()
Writes long integer to the end of file
public
writeLong(int $value) : void
Parameters
- $value : int
writeString()
Writes a string to the end of file.
public
writeString(string $str) : void
Parameters
- $str : string
Tags
writeVInt()
Writes a variable-length integer to the end of file.
public
writeVInt(int $value) : void
Parameters
- $value : int
_readLong32Bit()
Returns a long integer from the current position in the file, advances the file pointer and return it as float (for 32-bit platforms).
protected
_readLong32Bit() : int|float
Tags
Return values
int|float_writeLong32Bit()
Writes long integer to the end of file (32-bit platforms implementation)
protected
_writeLong32Bit(int|float $value) : void
Parameters
- $value : int|float
Tags
fread()
protected
abstract fread([int $length = 1 ]) : string
Parameters
- $length : int = 1
Return values
stringfwrite()
protected
abstract fwrite(mixed $data[, mixed $length = null ]) : void
Parameters
- $data : mixed
- $length : mixed = null