super();
try
{
// First byte is the type
if (in[0] != MSG_TYPE_DONE)
throw new DataFormatException("input is not a valid DoneMessage");
int pos = 1;
// sender
int length = getNextLength(in, pos);
String senderString = new String(in, pos, length, "UTF-8");
this.senderID = Integer.valueOf(senderString);
pos += length +1;
// destination
length = getNextLength(in, pos);
String destinationString = new String(in, pos, length, "UTF-8");
this.destination = Integer.valueOf(destinationString);
pos += length +1;
} catch (UnsupportedEncodingException e)
{
throw new DataFormatException("UTF-8 is not supported by this jvm.");
}
}