{
try
{
if (in[0] != MSG_TYPE_ECL_UPDATE)
{
throw new DataFormatException("byte[] is not a valid " +
this.getClass().getCanonicalName());
}
int pos = 1;
// Decode the cookie
int length = getNextLength(in, pos);
String cookieStr = new String(in, pos, length, "UTF-8");
this.cookie = new MultiDomainServerState(cookieStr);
pos += length + 1;
// Decode the serviceId
length = getNextLength(in, pos);
this.serviceId = new String(in, pos, length, "UTF-8");
pos += length + 1;
// Decode the draft changeNumber
length = getNextLength(in, pos);
this.draftChangeNumber = Integer.valueOf(
new String(in, pos, length, "UTF-8"));
pos += length + 1;
// Decode the msg
/* Read the mods : all the remaining bytes but the terminating 0 */
length = in.length - pos - 1;
byte[] encodedMsg = new byte[length];
System.arraycopy(in, pos, encodedMsg, 0, length);
ReplicationMsg rmsg =
ReplicationMsg.generateMsg(
encodedMsg, ProtocolVersion.getCurrentVersion());
this.updateMsg = (LDAPUpdateMsg)rmsg;
}
catch (UnsupportedEncodingException e)
{
throw new DataFormatException("UTF-8 is not supported by this jvm.");
}
}