//not an elf file. try PE parser
PE pe=PEParser.parse(path);
if(pe!=null)
{
PESignature ps =pe.getSignature();
if(ps==null||!ps.isValid())
{
//What is it?
Toast.makeText(this,"The file seems that it is neither an Elf file or PE file!",3).show();
throw new IOException(e);
}
}
else
{
//What is it?
Toast.makeText(this,"The file seems that it is neither an Elf file or PE file!",3).show();
throw new IOException(e);
}
How can I organize the above code, so that
//What is it? Toast.makeText(this,"The file seems that it is neither an Elf file or PE file!",3).show(); throw new IOException(e);
Appears only once, or just be better-looking(easy to read)?
Summary
Please comment or advise on organizing the if statements.