readLinesUntil
Retrieves the lines in the file with path this, up to upToBytes number of bytes. If the file size in bytes exceeds upToBytes, the lines are truncated up to the said byte size, an extra trailing string will be appended to indicate that it is truncated and the size in the format: "...<truncated ($upToBytes ?B of $totalNumOfBytes ?B)>"
, where
?B
refers to the byte unit (e.g. bytes, KB, MB, etc.),totalNumOfBytes
equals to the total number of bytes of the file. Otherwise all lines are retrieved.
The line splitting behavior of this method is determined by Configuration.Compat.PipelineStage.nioLineSplit.
Note that the current implementation only supports reading files up to Int.MAX_VALUE bytes. If the file exceeds this limit and upToBytes is greater than this limit, this method will throw NotImplementedError. Therefore, it is recommended to only set upToBytes up to Int.MAX_VALUE if the full file is required, or use NIO file utilities such as Files.lines (which is preferable anyways when handling large files).
Throws
when this file path does not exist.