Android FileInputStream Read readSomeDataFromFile(String path, byte[] data)

Here you can find the source of readSomeDataFromFile(String path, byte[] data)

Description

read Some Data From File

Declaration

public static void readSomeDataFromFile(String path, byte[] data) 

Method Source Code

//package com.java2s;

import java.io.File;

import java.io.FileInputStream;

import java.io.IOException;
import java.io.InputStream;

public class Main {
    public static void readSomeDataFromFile(String path, byte[] data) {
        InputStream is = null;/*from  w ww .  j av  a 2s  .  co  m*/
        try {
            File file = new File(path);
            is = new FileInputStream(file);
            is.read(data);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (is != null) {
                    is.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

Related

  1. fastStream(File file)
  2. getCredentials(FileInputStream fis)