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

Jean-Noël Rouvignac
28.10.2015 07e7cb84f497a907074b5ca46f3147f65488d6ed
opendj-server-legacy/src/main/java/org/opends/server/replication/protocol/ByteArrayBuilder.java
@@ -20,7 +20,7 @@
 *
 * CDDL HEADER END
 *
 *      Copyright 2014 ForgeRock AS
 *      Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.replication.protocol;
@@ -78,7 +78,7 @@
   */
  public ByteArrayBuilder appendBoolean(boolean b)
  {
    appendByte((byte) (b ? 1 : 0));
    appendByte(b ? 1 : 0);
    return this;
  }
@@ -89,9 +89,9 @@
   *          the byte to append.
   * @return this ByteArrayBuilder
   */
  public ByteArrayBuilder appendByte(byte b)
  public ByteArrayBuilder appendByte(int b)
  {
    builder.append(b);
    builder.appendByte(b);
    return this;
  }
@@ -102,9 +102,9 @@
   *          the short to append.
   * @return this ByteArrayBuilder
   */
  public ByteArrayBuilder appendShort(short s)
  public ByteArrayBuilder appendShort(int s)
  {
    builder.append(s);
    builder.appendShort(s);
    return this;
  }
@@ -117,7 +117,7 @@
   */
  public ByteArrayBuilder appendInt(int i)
  {
    builder.append(i);
    builder.appendInt(i);
    return this;
  }
@@ -130,7 +130,7 @@
   */
  public ByteArrayBuilder appendLong(long l)
  {
    builder.append(l);
    builder.appendLong(l);
    return this;
  }
@@ -170,7 +170,7 @@
  public ByteArrayBuilder appendStrings(Collection<String> col)
  {
    //appendInt() would have been safer, but byte is compatible with legacy code
    appendByte((byte) col.size());
    appendByte(col.size());
    for (String s : col)
    {
      appendString(s);
@@ -253,7 +253,7 @@
   */
  public ByteArrayBuilder appendByteArray(byte[] bytes)
  {
    builder.append(bytes);
    builder.appendBytes(bytes);
    return this;
  }
@@ -271,13 +271,13 @@
   */
  public ByteArrayBuilder appendZeroTerminatedByteArray(byte[] bytes)
  {
    builder.append(bytes);
    builder.appendBytes(bytes);
    return appendZeroSeparator();
  }
  private ByteArrayBuilder appendZeroSeparator()
  {
    builder.append((byte) 0);
    builder.appendByte(0);
    return this;
  }