super();
try
{
/* first byte is the type */
if (in[0] != MSG_TYPE_INITIALIZE_TARGET)
throw new DataFormatException(
"input is not a valid InitializeDestinationMessage");
int pos = 1;
// destination
int length = getNextLength(in, pos);
String destinationString = new String(in, pos, length, "UTF-8");
this.destination = Integer.valueOf(destinationString);
pos += length +1;
// baseDn
length = getNextLength(in, pos);
baseDN = new String(in, pos, length, "UTF-8");
pos += length +1;
// sender
length = getNextLength(in, pos);
String senderString = new String(in, pos, length, "UTF-8");
senderID = Integer.valueOf(senderString);
pos += length +1;
// requestor
length = getNextLength(in, pos);
String requestorString = new String(in, pos, length, "UTF-8");
requestorID = Integer.valueOf(requestorString);
pos += length +1;
// entryCount
length = getNextLength(in, pos);
String entryCountString = new String(in, pos, length, "UTF-8");
entryCount = Long.valueOf(entryCountString);
pos += length +1;
if (version >= ProtocolVersion.REPLICATION_PROTOCOL_V4)
{
// init window
length = getNextLength(in, pos);
String initWindowString = new String(in, pos, length, "UTF-8");
initWindow = Integer.valueOf(initWindowString);
pos += length +1;
}
}
catch (UnsupportedEncodingException e)
{
throw new DataFormatException("UTF-8 is not supported by this jvm.");
}
}