Class representing an open file. Some methods in this class are instance
variants of the same methods in nusys.FileSystem.
Variables
Methods
datasync ():Void
Same as sync, but metadata is not flushed unless needed for subsequent
data reads to be correct. E.g. changes to the modification times are not
flushed, but changes to the filesize do.
readBuffer (buffer:Bytes, offset:Int, length:Int, position:Int):{bytesRead:Int, buffer:Bytes}
Reads a part of this file into the given buffer.
Parameters:
buffer | Buffer to which data will be written. |
|---|---|
offset | Position in |
length | Number of bytes to read from |
position | Position in |
writeBuffer (buffer:Bytes, offset:Int, length:Int, position:Int):{bytesWritten:Int, buffer:Bytes}
Writes a part of the given buffer into this file.
Parameters:
buffer | Buffer from which data will be read. |
|---|---|
offset | Position in |
length | Number of bytes to write to |
position | Position in |
writeString (str:String, ?position:Int, ?encoding:Encoding):{bytesWritten:Int, buffer:Bytes}
Writes a string to this file at position.