// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
package mapfile;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;

public class Read1 {
	private static void test(String fnm) throws IOException {
		System.out.printf("%s %s / %s %s\n", System.getProperty("java.vendor"), System.getProperty("java.version"), System.getProperty("os.name"), System.getProperty("os.version"));
		long t1 = System.currentTimeMillis();
		List<String> lines = Files.readAllLines(Paths.get(fnm));
		System.out.printf("%d lines\n", lines.size());
		long t2 = System.currentTimeMillis();
		System.out.printf("Read all lines : %d ms\n", t2 - t1);
	}
	public static void main(String[] args) throws IOException {
		for(int i = 0; i < 3; i++) {
			test(args[0]);
		}
	}
}
