No, it doesn't have to be converted into binary format. It's already in binary format.
You read the bytes of the file and compare them against known virus patterns. Although the algorithm for that is probably much more complicated than the mechanics of reading a file, so you might be in over your head.
http://java.sun.com/docs/books/tutorial/essential/io/index.html
Don't flag your question as urgent, even if it is for you. Claiming urgency is very likely to be counter-productive: most forum regulars will simply ignore such messages as rude and selfish attempts to elicit immediate and special attention.
Besides, unless a pack of lusty wildebeest is about to chase you over the edge of a cliff if you don't get an answer in fifteen seconds, your problem probably isn't as urgent as you think. :o)
public class BinFormat
{
public static void main(String[] args) throws IOException
{
FileInputStream in = new FileInputStream("vcll.exe");
//FileOutputStream out = new FileOutputStream("out.bin");
int c;
while ((c = in.read()) != -1)
System.out.println(Integer.toBinaryString(c));
//out.write(c);
}
}
Thankyou.... but the while loop runs indefenitely.... the time it takes to complete the process is so large and the size of the output binary file is huge even if the input file is jus 100KB size.... This is the way that all virus scanners function? or am I making a notable mistake...