read ELF Header Indent Array - Android java.io

Android examples for java.io:FileInputStream

Description

read ELF Header Indent Array

Demo Code


//package com.java2s;

import android.util.Log;

import java.io.File;
import java.io.FileInputStream;

public class Main {
    private static boolean LOGENABLE = false;

    private static byte[] readELFHeadrIndentArray(File libFile) {
        if (libFile != null && libFile.exists()) {
            FileInputStream inputStream = null;
            try {
                inputStream = new FileInputStream(libFile);
                if (inputStream != null) {
                    byte[] tempBuffer = new byte[16];
                    int count = inputStream.read(tempBuffer, 0, 16);
                    if (count == 16) {
                        return tempBuffer;
                    }/*from  ww  w. j a v  a2  s.  com*/
                }
            } catch (Throwable t) {
        
            } finally {
                if (inputStream != null) {
                    try {
                        inputStream.close();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
        }

        return null;
    }
}

Related Tutorials