Java FileInputStream Read readFile(File target)

Here you can find the source of readFile(File target)

Description

read File

License

Open Source License

Declaration

public static String readFile(File target) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {

    public static String readFile(File target) {
        String adhocXml = null;//from ww w .  j av  a2  s.c o m
        try {
            FileInputStream fis = new FileInputStream(target);
            byte[] all = new byte[(int) target.length()];
            fis.read(all);
            fis.close();
            adhocXml = new String(all);
            return adhocXml;
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. readFile(File path)
  2. readfile(File path)
  3. readFile(File source)
  4. readFile(File src)
  5. readFile(File srcFile, OutputStream destStream)
  6. readFile(FileInputStream fileinputstream, byte abyte0[])
  7. readFile(final File file)
  8. readFile(final File file)
  9. readFile(final File file)