Here you can find the source of getFileSize(File file)
Parameter | Description |
---|---|
file | a parameter |
public static long getFileSize(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**//from www.j a v a 2 s . c o m * Returns file size. * * @param file * @return file size in bytes * @see //http://stackoverflow.com/questions/116574/java-get-file-size-efficiently */ public static long getFileSize(File file) { if (file.exists()) { return file.length(); } else { return 0; } } }