mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotParentIdAndRdnSerializer.java [230:282]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    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 )
        {
            LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) );
            throw new IOException( cnfe.getLocalizedMessage() );
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



mavibotv2-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotParentIdAndRdnSerializer.java [239:291]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    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 )
        {
            LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) );
            throw new IOException( cnfe.getLocalizedMessage() );
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



