mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

gbellato
11.07.2006 856b7df6e36147529232217fcd1310c3c869a81f
opends/src/server/org/opends/server/synchronization/UpdateMessage.java
@@ -282,12 +282,13 @@
    byte[] byteEntryuuid = getUniqueId().getBytes("UTF-8");
    /* The message header is stored in the form :
     * <operation type>changenumber><dn><entryuuid><change>
     * <operation type>changenumber><dn><assured><entryuuid><change>
     * the length of result byte array is therefore :
     *   1 + dn length + 1 + 24 + additional_length
     *   1 + change number length + 1 + dn length + 1  + 1 +
     *   uuid length + 1 + additional_length
     */
    int length = 1 + changeNumberByte.length + 1 + byteDn.length + 1
                 + byteEntryuuid.length + 1 + additionalLength;
    int length = 5 + changeNumberByte.length + byteDn.length
                 + byteEntryuuid.length + additionalLength;
    byte[] encodedMsg = new byte[length];
@@ -298,6 +299,9 @@
    /* put the ChangeNumber */
    pos = addByteArray(changeNumberByte, encodedMsg, pos);
    /* put the assured information */
    encodedMsg[pos++] = (assuredFlag ? (byte) 1 : 0);
    /* put the DN and a terminating 0 */
    pos = addByteArray(byteDn, encodedMsg, pos);
@@ -332,6 +336,12 @@
      pos += length + 1;
      changeNumber = new ChangeNumber(changenumberStr);
      /* read the assured information */
      if (encodedMsg[pos++] == 1)
        assuredFlag = true;
      else
        assuredFlag = false;
      /* read the dn */
      length = getNextLength(encodedMsg, pos);
      dn = new String(encodedMsg, pos, length, "UTF-8");