public static CharStream fromPath(Path path, Charset charset) throws IOException {
		long size = Files.size(path);
		try (ReadableByteChannel channel = Files.newByteChannel(path)) {
			return fromChannel(
				channel,
				charset,
				DEFAULT_BUFFER_SIZE,
				CodingErrorAction.REPLACE,
				path.toString(),
				size);
		}
	}
Creates a {@link CharStream} given a path to a file on disk and the
charset of the bytes contained in the file.

Reads the entire contents of the file into the result before returning.
runtime/Java/src/org/antlr/v4/runtime/CharStreams.java