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

Jean-Noël Rouvignac
28.10.2015 07e7cb84f497a907074b5ca46f3147f65488d6ed
opendj-server-legacy/src/test/java/org/opends/server/backends/jeb/TestJebFormat.java
@@ -222,12 +222,12 @@
         throws DirectoryException
  {
    // The version number will be one byte.
    buffer.append((byte)0x01);
    buffer.appendByte(0x01);
    // TODO: Can we encode the DN directly into buffer?
    byte[] dnBytes  = getBytes(entry.getName().toString());
    buffer.appendBERLength(dnBytes.length);
    buffer.append(dnBytes);
    buffer.appendBytes(dnBytes);
    // Encode number of OCs and 0 terminated names.
@@ -235,15 +235,15 @@
    ByteStringBuilder bsb = new ByteStringBuilder();
    for (String ocName : entry.getObjectClasses().values())
    {
      bsb.append(ocName);
      bsb.appendUtf8(ocName);
      if(i < entry.getObjectClasses().values().size())
      {
        bsb.append((byte)0x00);
        bsb.appendByte(0x00);
      }
      i++;
    }
    buffer.appendBERLength(bsb.length());
    buffer.append(bsb);
    buffer.appendBytes(bsb);
    // Encode the user attributes in the appropriate manner.
@@ -294,7 +294,7 @@
         throws DirectoryException
  {
    // The version number will be one byte.
    buffer.append((byte)0x02);
    buffer.appendByte(0x02);
    // Get the encoded respresentation of the config.
    config.encode(buffer);
@@ -307,7 +307,7 @@
      // TODO: Can we encode the DN directly into buffer?
      byte[] dnBytes  = getBytes(entry.getName().toString());
      buffer.appendBERLength(dnBytes.length);
      buffer.append(dnBytes);
      buffer.appendBytes(dnBytes);
    }
@@ -324,15 +324,15 @@
      ByteStringBuilder bsb = new ByteStringBuilder();
      for (String ocName : entry.getObjectClasses().values())
      {
        bsb.append(ocName);
        bsb.appendUtf8(ocName);
        if(i < entry.getObjectClasses().values().size())
        {
          bsb.append((byte)0x00);
          bsb.appendByte(0x00);
        }
        i++;
      }
      buffer.appendBERLength(bsb.length());
      buffer.append(bsb);
      buffer.appendBytes(bsb);
    }
@@ -383,7 +383,7 @@
          ByteStringBuilder bsb = new ByteStringBuilder();
          config.getCompressedSchema().encodeAttribute(bsb, a);
          buffer.appendBERLength(bsb.length());
          buffer.append(bsb);
          buffer.appendBytes(bsb);
        }
      }
    }
@@ -410,14 +410,14 @@
      for (Attribute a : attrList)
      {
        byte[] nameBytes = getBytes(a.getNameWithOptions());
        buffer.append(nameBytes);
        buffer.append((byte)0x00);
        buffer.appendBytes(nameBytes);
        buffer.appendByte(0x00);
        buffer.appendBERLength(a.size());
        for (ByteString v : a)
        {
          buffer.appendBERLength(v.length());
          buffer.append(v);
          buffer.appendBytes(v);
        }
      }
    }