Java File Content Read getFileContent(File file)

Here you can find the source of getFileContent(File file)

Description

get File Content

License

Open Source License

Declaration

public static String getFileContent(File file) throws IOException 

Method Source Code

//package com.java2s;

import java.io.File;

import java.io.FileReader;
import java.io.IOException;

public class Main {
    public static String getFileContent(File file) throws IOException {
        FileReader reader = new FileReader(file);
        char[] content = new char[(int) file.length()];
        reader.read(content, 0, content.length);
        return new String(content);
    }/*from ww w  .  j a va2s.  c  o m*/
}

Related

  1. getFileContent(File file)
  2. getFileContent(File file)
  3. getFileContent(File file)
  4. getFileContent(File file)
  5. getFileContent(File file)
  6. getFileContent(File file)
  7. getFileContent(File file)
  8. getFileContent(File file)
  9. getFileContent(File file)