Getting the Size of a File - Java File Path IO

Java examples for File Path IO:File Attribute

Description

Getting the Size of a File

Demo Code

import java.io.File;

public class Main {

  public void main(String[] argv) {
    File file = new File("infilename");

    // Get the number of bytes in the file
    long length = file.length();
  }/* w w  w.j  a  v  a 2  s.  com*/
}

Related Tutorials