Android examples for File Input Output:InputStream
read Buffered File
//package com.java2s; import java.io.*; public class Main { public static byte[] readBufferedFile(String filename) throws IOException { File file = new File(filename); ByteArrayOutputStream out = new ByteArrayOutputStream(); BufferedInputStream in = new BufferedInputStream( new FileInputStream(file)); int read; byte[] buff = new byte[1024]; while ((read = in.read(buff)) > 0) { out.write(buff, 0, read);/*from ww w . j a v a2 s . com*/ } out.flush(); byte[] audioBytes = out.toByteArray(); in.close(); return audioBytes; } }