Reading from a File
In the file frank.tif there is a message hidden in it. In hiding the message the first 80 bytes of the file are skipped. The hidden message is a text message. I need to be able to extract the message but I can't seem to get my coding to work correctly. Could someone please give me some suggestions as to what needs to be done to get the correct answer/output.
import java.io.*;
publicclass Frank
{
publicstaticvoid main(String[]args)
{
byte letters;
byte letter;
int countit=0;
try
{
DataInputStream file=new DataInputStream(new FileInputStream("frank.tif"));
file.skip(80);
do
{
letters=(byte)file.read();
int bit=letters & 0x01;
letter=(byte)(letters<<1);
letter |= bit;
countit++;
if(countit==8)
{
System.out.print(String.valueOf(letter)+"");
countit=0;
}
}
while(letters!=-1);
}
catch(IOException e)
{
System.out.println(e);
}
}
}

