Android examples for File Input Output:Byte Array Convert
read File using RandomAccessFile to byte array
//package com.java2s; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; public class Main { private static String readInstallationFile(File installation) throws IOException { RandomAccessFile f = new RandomAccessFile(installation, "r"); byte[] bytes = new byte[(int) f.length()]; f.readFully(bytes);//ww w . j a va 2s . c o m f.close(); return new String(bytes); } }