|
| __construct ($data) |
| Object constractor.
|
|
| seek ($offset, $whence=SEEK_SET) |
| Sets the file position indicator and advances the file pointer.
|
|
| tell () |
| Get file position.
|
|
| flush () |
| Flush output.
|
|
| lock ($lockType, $nonBlockinLock=false) |
| Lock file.
|
|
| unlock () |
| Unlock file.
|
|
| readByte () |
| Reads a byte from the current position in the file and advances the file pointer.
|
|
| writeByte ($byte) |
| Writes a byte to the end of the file.
|
|
| readBytes ($num) |
| Read num bytes from the current position in the file and advances the file pointer.
|
|
| writeBytes ($data, $num=null) |
| Writes num bytes of data (all, if $num===null) to the end of the string.
|
|
| readInt () |
| Reads an integer from the current position in the file and advances the file pointer.
|
|
| writeInt ($value) |
| Writes an integer to the end of file.
|
|
| readLong () |
| Returns a long integer from the current position in the file and advances the file pointer.
|
|
| writeLong ($value) |
| Writes long integer to the end of file.
|
|
| 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).
|
|
| writeLong32Bit ($value) |
| Writes long integer to the end of file (32-bit platforms implementation)
|
|
| readVInt () |
| Returns a variable-length integer from the current position in the file and advances the file pointer.
|
|
| writeVInt ($value) |
| Writes a variable-length integer to the end of file.
|
|
| readString () |
| Reads a string from the current position in the file and advances the file pointer.
|
|
| writeString ($str) |
| Writes a string to the end of file.
|
|
| readBinary () |
| Reads binary data from the current position in the file and advances the file pointer.
|
|
| seek ($offset, $whence=SEEK_SET) |
| Sets the file position indicator and advances the file pointer.
|
|
| tell () |
| Get file position.
|
|
| flush () |
| Flush output.
|
|
| lock ($lockType, $nonBlockinLock=false) |
| Lock file.
|
|
| unlock () |
| Unlock file.
|
|
| readByte () |
| Reads a byte from the current position in the file and advances the file pointer.
|
|
| writeByte ($byte) |
| Writes a byte to the end of the file.
|
|
| readBytes ($num) |
| Read num bytes from the current position in the file and advances the file pointer.
|
|
| writeBytes ($data, $num=null) |
| Writes num bytes of data (all, if $num===null) to the end of the string.
|
|
| readInt () |
| Reads an integer from the current position in the file and advances the file pointer.
|
|
| writeInt ($value) |
| Writes an integer to the end of file.
|
|
| readLong () |
| Returns a long integer from the current position in the file and advances the file pointer.
|
|
| writeLong ($value) |
| Writes long integer to the end of file.
|
|
| 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).
|
|
| writeLong32Bit ($value) |
| Writes long integer to the end of file (32-bit platforms implementation)
|
|
| readVInt () |
| Returns a variable-length integer from the current position in the file and advances the file pointer.
|
|
| writeVInt ($value) |
| Writes a variable-length integer to the end of file.
|
|
| readString () |
| Reads a string from the current position in the file and advances the file pointer.
|
|
| writeString ($str) |
| Writes a string to the end of file.
|
|
| readBinary () |
| Reads binary data from the current position in the file and advances the file pointer.
|
|
seek |
( |
|
$offset, |
|
|
|
$whence = SEEK_SET |
|
) |
| |
Sets the file position indicator and advances the file pointer.
The new position, measured in bytes from the beginning of the file, is obtained by adding offset to the position specified by whence, whose values are defined as follows: SEEK_SET - Set position equal to offset bytes. SEEK_CUR - Set position to current location plus offset. SEEK_END - Set position to end-of-file plus offset. (To move to a position before the end-of-file, you need to pass a negative value in offset.) Upon success, returns 0; otherwise, returns -1
- Parameters
-
integer | $offset | |
integer | $whence | |
- Returns
- integer
Writes a string to the end of file.
- Parameters
-
- Exceptions
-
This implementation supports only Basic Multilingual Plane (BMP) characters (from 0x0000 to 0xFFFF) and doesn't support "supplementary characters" (characters whose code points are greater than 0xFFFF) Java 2 represents these characters as a pair of char (16-bit) values, the first from the high-surrogates range (0xD800-0xDBFF), the second from the low-surrogates range (0xDC00-0xDFFF). Then they are encoded as usual UTF-8 characters in six bytes. Standard UTF-8 representation uses four bytes for supplementary characters.
String is already in Java 2 representation. We should only calculate actual string length and replace by