Java File Size Get getFileSizes(File f)

Here you can find the source of getFileSizes(File f)

Description

get File Sizes

License

LGPL

Declaration

public static long getFileSizes(File f) throws IOException 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.io.File;
import java.io.FileInputStream;

import java.io.IOException;

public class Main {

    public static long getFileSizes(File f) throws IOException {
        long s = 0;
        if (f.exists()) {
            FileInputStream fis = null;
            fis = new FileInputStream(f);
            s = fis.available();/*w w  w.  j a va2  s .  com*/
        }
        return s;
    }
}

Related

  1. getFileSizeAggregate(String[] files)
  2. getFileSizeFormat(double inputvalue)
  3. getFileSizeFormat(String total_size)
  4. getFileSizeLabel(long sizeInBytes)
  5. getFileSizeRecursive(File file, boolean subFolders)
  6. getFileSizeString(File file, boolean si)
  7. getFilesizeString(long size)
  8. getFileSizeStringFor(File file)
  9. getFolderSize(File folder)