read

Reads the entire content of a file associated with the abstract pathname into a Buffer.

docs

Return

Buffer

Throws

if there was a failure to read the file, or the filesystem threw a security exception.

UnsupportedOperationException

If Node.js is not being used.

Read the entire contents of a File into a ByteBuffer.

NOTE: This function is not recommended for large files. There is an internal limitation of 2GB file size.

Return

The data held in a ByteBuffer.

Throws

If there was a failure to read the File, such as its non-existence, not being a regular file, being too large, or the filesystem threw a security exception.