<p>newReader.</p>

@param file a {@link java.io.File} object.
@return a {@link java.io.Reader} object.
@throws java.io.IOException if any.
351137
public static Reader newReader(File file)
            throws IOException
    {
        final String fileEncoding = System.getProperty( "file.encoding", "UTF-8" );
        final String greenPepperEncoding = System.getProperty( "greenpepper.file.encoding", fileEncoding );
        return newReader( file, greenPepperEncoding );
    }
464551
@SuppressWarnings("unchecked")
    public static <T> T load(File file) {
        try {
            FileInputStream fis = new FileInputStream(file);
            ObjectInputStream inStream = 
                new ObjectInputStream(new BufferedInputStream(fis));
            T object = (T) inStream.readObject();
            inStream.close();
            return object;
        } catch (IOException ioe) {
            throw new IOError(ioe);
        } catch (ClassNotFoundException cnfe) {
            throw new IOError(cnfe);
        }
    }
672991
public static synchronized XMLEventReader createFileReader(final File paramFile) throws IOException,
        XMLStreamException {
        final XMLInputFactory factory = XMLInputFactory.newInstance();
        factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
        final InputStream in = new FileInputStream(paramFile);
        return factory.createXMLEventReader(in);
    }
564599
public static List<String> readLines(File file) throws IOException {
        List<String> lines = new ArrayList<String>();
        InputStreamReader reader = null;
        BufferedReader bufferedReader = null;
        try {
            reader = new FileReader(file);
            bufferedReader = new BufferedReader(reader);
            String lineText = null;
            while ((lineText = bufferedReader.readLine()) != null) {
                lines.add(lineText);
            }
            return lines;
        } finally {
            if (bufferedReader != null) {
                bufferedReader.close();
            }
            if (reader != null) {
                reader.close();
            }
        }
    }
187730
public static byte[] readFile(File file) throws IOException
    {
        //create stream to file
        InputStream inputStream=new FileInputStream(file);

        //read data
        byte[] data=IOHelper.readStream(inputStream);

        return data;
    }
269166
public static Study readStudy(final File file) throws IOException {
        checkNotNull(file);
        try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
            return readStudy(reader);
        }
    }
478960
public static Instance readInstance(File f) {
        try (Reader in = makeIn(f)) {
            return readInstance(in);
        } catch (IOException e) {
            throw new IllegalArgumentException(e);
        }
    }
18915
public static Sample readSample(final File file) throws IOException {
        checkNotNull(file);
        try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
            return readSample(reader);
        }
    }
614099
public static String readTextFile(File file) throws IOException
    {
        //create reader to file (with default encoding)
        InputStream inputStream=new FileInputStream(file);
        Reader reader=IOHelper.createReader(inputStream,null);

        //read text
        String text=IOHelper.readTextStream(reader);
        
        return text;
    }
534267
public static String readFile(File file, long start, int length) throws IOException {
        byte[] bs = new byte[length];
        try (FileInputStream fis = new FileInputStream(file)) {
            fis.skip(start);
            fis.read(bs);
        }
        return new String(bs);
    }
1336555
public static ClassFileReader newInstance(Path path, JarFile jf) throws IOException {
        return new JarFileReader(path, jf);
    }
396291
public static KAFDocument createFromFile(File file) throws IOException {
	KAFDocument kaf = null;
	try {
	    kaf = ReadWriteManager.load(file);
	} catch(JDOMException e) {
	    e.printStackTrace();
	}
	return kaf;
    }
736752
public static boolean createNewFile(File file) throws IOException {
        createFolder(file.getParent());
        return (!file.exists() || file.delete()) && file.createNewFile();
    }
1370655
@Override
    public T fromFile(final String file) throws IllegalArgumentException, DescriptorImportException {
        return this.from(new File(file));
    }
1310665
public static BufferedReader newBufferedReader(Path path, Charset charset) throws IOException {
        return new BufferedReader(new InputStreamReader(newInputStream(path), charset));
    }
1256138
public static BufferedWriter createWriter(File file) throws IOException {
        OutputStream os = new FileOutputStream(file);
        if (file.getName().toLowerCase().endsWith(".gz"))
            os = new GZIPOutputStream(os);
        return new BufferedWriter(new OutputStreamWriter(os, StandardCharsets.UTF_8));
    }
1057701
public static String readFile( File file ) throws IOException {
        if (!file.exists()) {
            throw new FileNotFoundException("The required projection file is not available: " + file.getAbsolutePath());
        }
        try (BufferedReader br = new BufferedReader(new FileReader(file))) {
            StringBuilder sb = new StringBuilder(200);
            String line;
            while( (line = br.readLine()) != null ) {
                sb.append(line);
                sb.append("\n"); //$NON-NLS-1$
            }
            return sb.toString();
        }
    }