@Override
public ParentIdAndRdn fromBytes( byte[] buffer, int pos ) throws IOException
{
try
{
ParentIdAndRdn parentIdAndRdn = new ParentIdAndRdn();
// Read the number of rdns, if any
int nbRdns = Serialize.deserializeInt( buffer, pos );
pos += 4;
if ( nbRdns == 0 )
{
parentIdAndRdn.setRdns( new Rdn[0] );
}
else
{
Rdn[] rdns = new Rdn[nbRdns];
for ( int i = 0; i < nbRdns; i++ )
{
Rdn rdn = new Rdn( schemaManager );
pos = rdn.deserialize( buffer, pos );
rdns[i] = rdn;
}
parentIdAndRdn.setRdns( rdns );
}
// Read the parent ID
byte[] uuidBytes = Serialize.deserializeBytes( buffer, pos );
pos += 4 + uuidBytes.length;
String uuid = Strings.utf8ToString( uuidBytes );
parentIdAndRdn.setParentId( uuid );
// Read the number of children and descendants
int nbChildren = Serialize.deserializeInt( buffer, pos );
pos += 4;
int nbDescendants = Serialize.deserializeInt( buffer, pos );
pos += 4;
parentIdAndRdn.setNbChildren( nbChildren );
parentIdAndRdn.setNbDescendants( nbDescendants );
return parentIdAndRdn;
}
catch ( LdapInvalidAttributeValueException cnfe )
{