I have the same problem it gives me an ecxeption ,I tried your code Steve but i had this statement which you put in the exception:
Not a number on the last 4 characters
but the problem is the recv_message is as following:
Hello Bob, how are you? I am going to go to the movie tonight. I plan to see Gonewith the Wind. I really like Clark Gable. Would you like to go with me? I would really like to have some company. Your friend, Alice5113350515586806264156901277970003516182249744328267808527911381008517422384937086806339111024080220
i got it from appending two files
the last four characters 0220 i got them from representing the length of the message in four characters by this code :
String My_Meesage_Length = "" + len;
//Confirm number of characters in the string.
if((My_Meesage_Length.length() > 4)
|| (My_Meesage_Length.length() <= 0)){
System.out.println("Message length error.");
System.exit(0);
}//end if
//Prepend leading zeros if necessary
if(My_Meesage_Length.length() == 1){
aliceMsgLenAsStr = "000"
+My_Meesage_Length;
}else if(My_Meesage_Length.length() == 2){
My_Meesage_Length= "00" + My_Meesage_Length;
}else if(aliceMsgLenAsStr.length() == 3){
My_Meesage_Length = "0" + My_Meesage_Length;
}else if(My_Meesage_Length.length() == 1){
My_Meesage_Length = "000"
+ My_Meesage_Length;
}
System.out.println(My_Meesage_Length);
so this may makes the problem more clear...
so by this the last four characters are numbers so why it keeps give me the same problem...plz any help