this will only give me the length of the last line in the Mesage not
the length of all the message ,so when I Put this statement after while
loop :
len=Input_Message.length();
System.out.println(len);
it will give null exeption:
java.lang.NullPointerException
at final_append.CopyBytes.main(CopyBytes.java:19)
Exception in thread "main"
So what i can do????
int len = 0;
> try{
> FileInputStream Message_File=new FileInputStream
> ("C:/JBuilder4/lib/output8.txt");
> BufferedReader buff=new BufferedReader(new
> InputStreamReader(Message_File));
> String Input_Message=new String();
> System.out.println("Your input message is as following:");
> while((Input_Message=buff.readLine() )!=null)
> {
> // Calculating the the length of our message in unit of bits
> System.out.println(Input_Message);
> len=Input_Message.length();
//summarize length values
len += Input_Message.length();
> System.out.println(len);}
} // end while
> System.out.println("entire length: " + len);}
> {catch......
--
Heiner Kücker
www.heinerkuecker.de
www.control-and-command.de