Java RandomAccessFile Read readFile(String filePath)

Here you can find the source of readFile(String filePath)

Description

read File

License

Open Source License

Declaration

@SuppressWarnings("resource")
    public static String readFile(String filePath) throws IOException 

Method Source Code


//package com.java2s;
import java.io.File;

import java.io.IOException;

import java.io.RandomAccessFile;

public class Main {
    @SuppressWarnings("resource")
    public static String readFile(String filePath) throws IOException {
        RandomAccessFile raf = new RandomAccessFile(new File(filePath), "r");
        String content = raf.readUTF();
        return content;
    }/* www . ja v a 2s . c  o  m*/
}

Related

  1. readFile(final File file)
  2. readFile(String absoluteFileName)
  3. readFile(String file)
  4. readFile(String file)
  5. readFile(String filename)
  6. readFileByRandomAccess(String fileName)
  7. readFileBytes(final File file)
  8. readFileFully(File f)
  9. readLine(RandomAccessFile file, long position, int trim)