Returns the contents of a file as bytes.
Returns the contents of a file as bytes. Throws FileNotFoundException if the file is not found.
File to read
Returns the contents of a file as bytes.
Returns the contents of a file as bytes. Throws FileNotFoundException if the file is not found.
Full path to file to read
Read bytes from an input stream.
Read bytes from an input stream. The input stream will be closed by this method after reading
Input stream
Returns the contents of a resource as bytes; null if the resource was not found.
Returns the contents of a resource as bytes; null if the resource was not found.
Class path of the resource in the classpath. Do **NOT** put a leading "/". See article
Auto close streams with automatic resource management
Auto close streams with automatic resource management
Example usage
using(new BufferedReader(new FileReader("file"))) { r =>
var count = 0
while (r.readLine != null) count += 1
println(count)
}
Utility IO methods