Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 65920 invoked from network); 9 Oct 2005 13:49:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Oct 2005 13:49:50 -0000 Received: (qmail 99325 invoked by uid 500); 9 Oct 2005 13:49:50 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 99280 invoked by uid 500); 9 Oct 2005 13:49:50 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 99268 invoked by uid 99); 9 Oct 2005 13:49:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Oct 2005 06:49:49 -0700 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 09 Oct 2005 06:49:51 -0700 Received: (qmail 65883 invoked by uid 65534); 9 Oct 2005 13:49:27 -0000 Message-ID: <20051009134927.65881.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r307430 - in /directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo: ./ filters/ Date: Sun, 09 Oct 2005 13:49:23 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: elecharny Date: Sun Oct 9 06:49:07 2005 New Revision: 307430 URL: http://svn.apache.org/viewcvs?rev=307430&view=rev Log: Modification of all those classes to reflect the modifications done in primitives and asn1 project Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AddRequest.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AttributeValueAssertion.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindResponse.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/CompareRequest.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/Control.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/DelRequest.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedRequest.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedResponse.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapResult.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyRequest.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SaslCredentials.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchRequest.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultReference.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SimpleAuthentication.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/AttributeValueAssertionFilter.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ConnectorFilter.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ExtensibleMatchFilter.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/PresentFilter.java directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/SubstringFilter.java Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AddRequest.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AddRequest.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AddRequest.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AddRequest.java Sun Oct 9 06:49:07 2005 @@ -133,7 +133,7 @@ */ public void addAttributeType( LdapString type ) { - currentAttribute = new BasicAttribute( type.toString().toLowerCase() ); + currentAttribute = new BasicAttribute( type.getString().toLowerCase() ); attributes.put( currentAttribute ); } @@ -154,7 +154,7 @@ */ public String getEntry() { - return ( ( entry == null ) ? "" : entry.toString() ); + return ( ( entry == null ) ? "" : entry.getString() ); } /** @@ -210,7 +210,7 @@ public int computeLength() { // The entry - addRequestLength = 1 + Length.getNbBytes( entry.getLength() ) + entry.getLength(); + addRequestLength = 1 + Length.getNbBytes( entry.getNbBytes() ) + entry.getNbBytes(); // The attributes sequence attributesLength = 0; @@ -245,7 +245,7 @@ { OctetString value = (OctetString)values.next(); - localValuesLength += 1 + Length.getNbBytes( value.getLength() ) + value.getLength(); + localValuesLength += 1 + Length.getNbBytes( value.getNbBytes() ) + value.getNbBytes(); } localAttributeLength += 1 + Length.getNbBytes( localValuesLength ) + localValuesLength; @@ -317,7 +317,7 @@ buffer.put( Length.getBytes( addRequestLength ) ) ; // The entry - Value.encode( buffer, entry ); + Value.encode( buffer, entry.getBytes() ); // The attributes sequence buffer.put( UniversalTag.SEQUENCE_TAG ); Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AttributeValueAssertion.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AttributeValueAssertion.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AttributeValueAssertion.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/AttributeValueAssertion.java Sun Oct 9 06:49:07 2005 @@ -73,7 +73,7 @@ */ public String getAttributeDesc() { - return ( ( attributeDesc == null ) ? null : attributeDesc.toString() ); + return ( ( attributeDesc == null ) ? null : attributeDesc.getString() ); } /** Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindRequest.java Sun Oct 9 06:49:07 2005 @@ -185,7 +185,7 @@ bindRequestLength = 1 + 1 + 1; // Initialized with version // The name - bindRequestLength += 1 + Length.getNbBytes( name.getLength() ) + name.getLength(); + bindRequestLength += 1 + Length.getNbBytes( name.getNbBytes() ) + name.getNbBytes(); // The authentication bindRequestLength += authentication.computeLength(); @@ -235,7 +235,7 @@ Value.encode( buffer, version ); // The name - Value.encode( buffer, name ); + Value.encode( buffer, name.getBytes() ); // The authentication authentication.encode( buffer ); Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindResponse.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindResponse.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindResponse.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/BindResponse.java Sun Oct 9 06:49:07 2005 @@ -105,7 +105,7 @@ if (serverSaslCreds != null) { - bindResponseLength += 1 + Length.getNbBytes(serverSaslCreds.getLength()) + serverSaslCreds.getLength(); + bindResponseLength += 1 + Length.getNbBytes(serverSaslCreds.getNbBytes()) + serverSaslCreds.getNbBytes(); } return 1 + Length.getNbBytes( bindResponseLength ) + bindResponseLength; @@ -142,9 +142,9 @@ if ( serverSaslCreds != null ) { buffer.put( (byte)LdapConstants.SERVER_SASL_CREDENTIAL_TAG ); - buffer.put( Length.getBytes( serverSaslCreds.getLength() ) ); + buffer.put( Length.getBytes( serverSaslCreds.getNbBytes() ) ); - if ( serverSaslCreds.getLength() != 0 ) + if ( serverSaslCreds.getNbBytes() != 0 ) { buffer.put( serverSaslCreds.getValue() ); } Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/CompareRequest.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/CompareRequest.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/CompareRequest.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/CompareRequest.java Sun Oct 9 06:49:07 2005 @@ -93,7 +93,7 @@ */ public String getEntry() { - return ( ( entry == null ) ? "" : entry.toString() ); + return ( ( entry == null ) ? "" : entry.getString() ); } /** @@ -133,7 +133,7 @@ */ public String getAttributeDesc() { - return ( ( attributeDesc == null ) ? "" : attributeDesc.toString() ); + return ( ( attributeDesc == null ) ? "" : attributeDesc.getString() ); } /** @@ -171,12 +171,12 @@ { // The entry - compareRequestLength = 1 + Length.getNbBytes( entry.getLength() ) + entry.getLength(); + compareRequestLength = 1 + Length.getNbBytes( entry.getNbBytes() ) + entry.getNbBytes(); // The attribute value assertion avaLength = - 1 + Length.getNbBytes( attributeDesc.getLength() ) + attributeDesc.getLength() + - 1 + Length.getNbBytes( assertionValue.getLength() ) + assertionValue.getLength(); + 1 + Length.getNbBytes( attributeDesc.getNbBytes() ) + attributeDesc.getNbBytes() + + 1 + Length.getNbBytes( assertionValue.getNbBytes() ) + assertionValue.getNbBytes(); compareRequestLength += 1 + Length.getNbBytes( avaLength ) + avaLength; @@ -211,7 +211,7 @@ buffer.put( Length.getBytes( compareRequestLength ) ) ; // The entry - Value.encode( buffer, entry ); + Value.encode( buffer, entry.getBytes() ); // The attributeValueAssertion sequence Tag buffer.put( UniversalTag.SEQUENCE_TAG ); @@ -223,7 +223,7 @@ } // The attributeDesc - Value.encode( buffer, attributeDesc ); + Value.encode( buffer, attributeDesc.getString() ); // The assertionValue Value.encode( buffer, assertionValue ); Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/Control.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/Control.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/Control.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/Control.java Sun Oct 9 06:49:07 2005 @@ -48,6 +48,8 @@ /** The control length */ private transient int controlLength; + + private static final byte[] EMPTY_BYTES = new byte[]{}; //~ Methods ------------------------------------------------------------------------------------ @@ -78,7 +80,7 @@ */ public byte[] getControlValue() { - return controlValue == null ? new byte[]{} : controlValue.getValue(); + return controlValue == null ? EMPTY_BYTES : controlValue.getValue(); } /** @@ -142,7 +144,7 @@ // The control value, if any if (controlValue != null) { - controlLength += 1 + Length.getNbBytes( controlValue.getLength() ) + controlValue.getLength(); + controlLength += 1 + Length.getNbBytes( controlValue.getNbBytes() ) + controlValue.getNbBytes(); } return 1 + Length.getNbBytes( controlLength ) + controlLength; Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/DelRequest.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/DelRequest.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/DelRequest.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/DelRequest.java Sun Oct 9 06:49:07 2005 @@ -67,7 +67,7 @@ */ public String getEntry() { - return ( ( entry == null ) ? "" : entry.toString() ); + return ( ( entry == null ) ? "" : entry.getString() ); } /** @@ -94,7 +94,7 @@ public int computeLength() { // The entry - return 1 + Length.getNbBytes( entry.getLength() ) + entry.getLength(); + return 1 + Length.getNbBytes( entry.getNbBytes() ) + entry.getNbBytes(); } /** @@ -120,8 +120,8 @@ buffer.put( LdapConstants.DEL_REQUEST_TAG ); // The entry - buffer.put( Length.getBytes( entry.getLength() ) ); - buffer.put( entry.getData() ); + buffer.put( Length.getBytes( entry.getNbBytes() ) ); + buffer.put( entry.getBytes() ); } catch ( BufferOverflowException boe ) { Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedRequest.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedRequest.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedRequest.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedRequest.java Sun Oct 9 06:49:07 2005 @@ -130,7 +130,7 @@ if ( requestValue != null) { - extendedRequestLength += 1 + Length.getNbBytes( requestValue.getLength() ) + requestValue.getLength(); + extendedRequestLength += 1 + Length.getNbBytes( requestValue.getNbBytes() ) + requestValue.getNbBytes(); } return 1 + Length.getNbBytes( extendedRequestLength ) + extendedRequestLength; @@ -178,9 +178,9 @@ if ( requestValue != null ) { buffer.put( (byte)LdapConstants.EXTENDED_REQUEST_VALUE_TAG ); - buffer.put( Length.getBytes( requestValue.getLength() ) ); + buffer.put( Length.getBytes( requestValue.getNbBytes() ) ); - if ( requestValue.getLength() != 0 ) + if ( requestValue.getNbBytes() != 0 ) { buffer.put( requestValue.getValue() ); } Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedResponse.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedResponse.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedResponse.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ExtendedResponse.java Sun Oct 9 06:49:07 2005 @@ -140,8 +140,8 @@ if ( response != null ) { - extendedResponseLength += 1 + Length.getNbBytes( response.getLength() ) + - response.getLength(); + extendedResponseLength += 1 + Length.getNbBytes( response.getNbBytes() ) + + response.getNbBytes(); } } @@ -192,9 +192,9 @@ if ( response != null ) { buffer.put( (byte)LdapConstants.EXTENDED_RESPONSE_RESPONSE_TAG ); - buffer.put( Length.getBytes( response.getLength() ) ); + buffer.put( Length.getBytes( response.getNbBytes() ) ); - if ( response.getLength() != 0 ) + if ( response.getNbBytes() != 0 ) { buffer.put( response.getValue() ); } Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapResult.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapResult.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapResult.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapResult.java Sun Oct 9 06:49:07 2005 @@ -123,7 +123,7 @@ */ public String getErrorMessage() { - return ( ( errorMessage == null ) ? null : errorMessage.toString() ); + return ( ( errorMessage == null ) ? null : errorMessage.getString() ); } /** @@ -231,10 +231,10 @@ ldapResultLength = 1 + 1 + 1; // The matchedDN length - ldapResultLength += 1 + Length.getNbBytes( matchedDN.getLength() ) + matchedDN.getLength(); + ldapResultLength += 1 + Length.getNbBytes( matchedDN.getNbBytes() ) + matchedDN.getNbBytes(); // The errorMessage length - ldapResultLength += 1 + Length.getNbBytes( errorMessage.getLength() ) + errorMessage.getLength(); + ldapResultLength += 1 + Length.getNbBytes( errorMessage.getNbBytes() ) + errorMessage.getNbBytes(); if ( ( referrals != null ) && ( referrals.size() != 0 ) ) { @@ -247,7 +247,7 @@ { LdapURL referral = ( LdapURL ) referralIterator.next(); - referralsLength += 1 + Length.getNbBytes( referral.getLength() ) + referral.getLength(); + referralsLength += 1 + Length.getNbBytes( referral.getNbBytes() ) + referral.getNbBytes(); } // The referrals @@ -283,10 +283,10 @@ } // The matchedDN - Value.encode( buffer, matchedDN); + Value.encode( buffer, matchedDN.getBytes() ); // The error message - Value.encode( buffer, errorMessage); + Value.encode( buffer, errorMessage.getBytes() ); // The referrals, if any if ( ( referrals != null ) && ( referrals.size() != 0 ) ) @@ -304,7 +304,7 @@ LdapURL referral = ( LdapURL ) referralIterator.next(); // Ecode the current referral - Value.encode( buffer, referral); + Value.encode( buffer, referral.getBytes() ); } } Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyDNRequest.java Sun Oct 9 06:49:07 2005 @@ -24,8 +24,7 @@ import org.apache.asn1new.ber.tlv.Value; import org.apache.asn1new.ldap.codec.LdapConstants; import org.apache.asn1new.ldap.codec.primitives.LdapDN; -import org.apache.asn1new.ldap.codec.primitives.RelativeLdapDN; - +import org.apache.asn1new.ldap.codec.primitives.LdapRDN; /** * A ModifyDNRequest Message. Its syntax is : @@ -45,7 +44,7 @@ private LdapDN entry; /** The new RDN to be added to the RDN or to the new superior, if present */ - private RelativeLdapDN newRDN; + private LdapRDN newRDN; /** If the previous RDN is to be deleted, this flag will be set to true */ private boolean deleteOldRDN; @@ -84,7 +83,7 @@ */ public String getEntry() { - return ( ( entry == null ) ? "" : entry.toString() ); + return ( ( entry == null ) ? "" : entry.getString() ); } /** @@ -123,7 +122,7 @@ */ public String getNewRDN() { - return ( ( newRDN == null ) ? "" : newRDN.toString() ); + return ( ( newRDN == null ) ? "" : newRDN.getString() ); } /** @@ -131,7 +130,7 @@ * * @param newRDN The newRDN to set. */ - public void setNewRDN( RelativeLdapDN newRDN ) + public void setNewRDN( LdapRDN newRDN ) { this.newRDN = newRDN; } @@ -143,7 +142,7 @@ */ public String getNewSuperior() { - return ( ( newSuperior == null ) ? "" : newSuperior.toString() ); + return ( ( newSuperior == null ) ? "" : newSuperior.getString() ); } /** @@ -180,14 +179,14 @@ { modifyDNRequestLength = - 1 + Length.getNbBytes( entry.getLength() ) + entry.getLength() + - 1 + Length.getNbBytes( newRDN.getLength() ) + newRDN.getLength() + + 1 + Length.getNbBytes( entry.getNbBytes() ) + entry.getNbBytes() + + 1 + Length.getNbBytes( newRDN.getNbBytes() ) + newRDN.getNbBytes() + 1 + 1 + 1; // deleteOldRDN if ( newSuperior != null ) { - modifyDNRequestLength += 1 + Length.getNbBytes( newSuperior.getLength() ) + - newSuperior.getLength(); + modifyDNRequestLength += 1 + Length.getNbBytes( newSuperior.getNbBytes() ) + + newSuperior.getNbBytes(); } return 1 + Length.getNbBytes( modifyDNRequestLength ) + modifyDNRequestLength; @@ -221,10 +220,10 @@ buffer.put( Length.getBytes( modifyDNRequestLength ) ) ; // The entry - Value.encode( buffer, entry ); + Value.encode( buffer, entry.getBytes() ); // The newRDN - Value.encode( buffer, newRDN ); + Value.encode( buffer, newRDN.getBytes() ); // The flag deleteOldRdn Value.encode( buffer, deleteOldRDN ); @@ -234,11 +233,11 @@ { // Encode the reference buffer.put( (byte)LdapConstants.MODIFY_DN_REQUEST_NEW_SUPERIOR_TAG ); - buffer.put( Length.getBytes( newSuperior.getLength() ) ); + buffer.put( Length.getBytes( newSuperior.getNbBytes() ) ); - if ( newSuperior.getLength() != 0 ) + if ( newSuperior.getNbBytes() != 0 ) { - buffer.put( newSuperior.getData() ); + buffer.put( newSuperior.getBytes() ); } } } Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyRequest.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyRequest.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyRequest.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/ModifyRequest.java Sun Oct 9 06:49:07 2005 @@ -21,6 +21,7 @@ import org.apache.asn1new.ber.tlv.UniversalTag; import org.apache.asn1new.ber.tlv.Value; import org.apache.asn1new.primitives.OctetString; +import org.apache.asn1new.util.StringUtils; import org.apache.asn1new.ldap.codec.LdapConstants; import org.apache.asn1new.ldap.codec.primitives.LdapDN; import org.apache.asn1new.ldap.codec.primitives.LdapString; @@ -159,7 +160,7 @@ */ public void addAttributeTypeAndValues( LdapString type ) { - currentAttribute = new BasicAttribute( type.toString().toLowerCase() ); + currentAttribute = new BasicAttribute( StringUtils.lowerCase( type.getString() ) ); int operation = 0; @@ -200,7 +201,7 @@ */ public String getObject() { - return ( ( object == null ) ? "" : object.toString() ); + return ( ( object == null ) ? "" : object.getString() ); } /** @@ -278,7 +279,7 @@ public int computeLength() { // Initialized with object - modifyRequestLength = 1 + Length.getNbBytes( object.getLength() ) + object.getLength(); + modifyRequestLength = 1 + Length.getNbBytes( object.getNbBytes() ) + object.getNbBytes(); // Modifications modificationsLength = 0; @@ -314,7 +315,7 @@ { OctetString value = (OctetString)values.next(); - localValuesLength += 1 + Length.getNbBytes( value.getLength() ) + value.getLength(); + localValuesLength += 1 + Length.getNbBytes( value.getNbBytes() ) + value.getNbBytes(); } } @@ -387,7 +388,7 @@ buffer.put( Length.getBytes( modifyRequestLength ) ) ; // The entry - Value.encode( buffer, object ); + Value.encode( buffer, object.getBytes() ); // The modifications sequence buffer.put( UniversalTag.SEQUENCE_TAG ); Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SaslCredentials.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SaslCredentials.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SaslCredentials.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SaslCredentials.java Sun Oct 9 06:49:07 2005 @@ -82,7 +82,7 @@ public String getMechanism() { - return ( ( mechanism == null ) ? null : mechanism.toString() ); + return ( ( mechanism == null ) ? null : mechanism.getString() ); } /** @@ -111,11 +111,11 @@ */ public int computeLength() { - int saslLength = 1 + Length.getNbBytes( mechanism.getLength() ) + mechanism.getLength(); + int saslLength = 1 + Length.getNbBytes( mechanism.getNbBytes() ) + mechanism.getNbBytes(); if (credentials != null) { - saslLength += 1 + Length.getNbBytes( credentials.getLength() ) + credentials.getLength(); + saslLength += 1 + Length.getNbBytes( credentials.getNbBytes() ) + credentials.getNbBytes(); } if ( log.isDebugEnabled() ) @@ -149,8 +149,8 @@ { // The saslAuthentication Tag buffer.put( (byte)LdapConstants.BIND_REQUEST_SASL_TAG ); - buffer.put( Length.getBytes( mechanism.getLength() ) ) ; - buffer.put( mechanism.getData() ) ; + buffer.put( Length.getBytes( mechanism.getNbBytes() ) ) ; + buffer.put( mechanism.getBytes() ) ; if ( credentials != null ) { Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchRequest.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchRequest.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchRequest.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchRequest.java Sun Oct 9 06:49:07 2005 @@ -24,7 +24,9 @@ import org.apache.asn1new.ldap.codec.primitives.LdapDN; import org.apache.asn1new.ldap.codec.primitives.LdapString; import org.apache.asn1new.ldap.pojo.filters.Filter; +import org.apache.asn1new.util.StringUtils; +import java.io.UnsupportedEncodingException; import java.nio.BufferOverflowException; import java.nio.ByteBuffer; @@ -124,7 +126,7 @@ */ public void addAttribute( LdapString attribute ) { - attributes.put( new BasicAttribute( attribute.toString().toLowerCase() ) ); + attributes.put( new BasicAttribute( StringUtils.lowerCase( attribute.getString() ) ) ); } /** @@ -142,7 +144,7 @@ */ public String getBaseObject() { - return ( ( baseObject == null ) ? null : baseObject.toString() ); + return ( ( baseObject == null ) ? null : baseObject.getString() ); } /** @@ -324,7 +326,7 @@ searchRequestLength = 0; // The baseObject - searchRequestLength += 1 + Length.getNbBytes( baseObject.getLength() ) + baseObject.getLength(); + searchRequestLength += 1 + Length.getNbBytes( baseObject.getNbBytes() ) + baseObject.getNbBytes(); // The scope searchRequestLength += 1 + 1 + 1; @@ -357,8 +359,21 @@ Attribute attribute = (BasicAttribute)attributeIterator.nextElement(); // add the attribute length to the attributes length - int idLength = attribute.getID().getBytes().length; - attributeDescriptionListLength += 1 + Length.getNbBytes( idLength ) + idLength; + try + { + int idLength = attribute.getID().getBytes( "UTF-8" ).length; + attributeDescriptionListLength += 1 + Length.getNbBytes( idLength ) + idLength; + } + catch ( UnsupportedEncodingException uee ) + { + // Should not be possible. The encoding of the Attribute ID + // will check that this ID is valid, and if not, it will throw + // an exception. + // The allocated length will be set to a null length value + // in order to avoid an exception thrown while encoding the + // Attribute ID. + attributeDescriptionListLength += 1 + 1; + } } } @@ -403,7 +418,7 @@ buffer.put( Length.getBytes( searchRequestLength ) ) ; // The baseObject - Value.encode( buffer, baseObject ); + Value.encode( buffer, baseObject.getBytes() ); // The scope Value.encodeEnumerated( buffer, scope ); Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultEntry.java Sun Oct 9 06:49:07 2005 @@ -26,6 +26,7 @@ import org.apache.asn1new.ldap.codec.primitives.LdapDN; import org.apache.asn1new.ldap.codec.primitives.LdapString; +import java.io.UnsupportedEncodingException; import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.util.LinkedList; @@ -113,7 +114,7 @@ */ public String getObjectName() { - return ( ( objectName == null ) ? null : objectName.toString() ); + return ( ( objectName == null ) ? null : objectName.getString() ); } /** @@ -166,7 +167,7 @@ */ public void addAttributeValues( LdapString type ) { - currentAttributeValue = new BasicAttribute( type.toString().toLowerCase() ); + currentAttributeValue = new BasicAttribute( StringUtils.lowerCase( type.getString() ) ); partialAttributeList.put( currentAttributeValue ); } @@ -223,7 +224,7 @@ public int computeLength() { // The entry - searchResultEntryLength = 1 + Length.getNbBytes( objectName.getLength() ) + objectName.getLength(); + searchResultEntryLength = 1 + Length.getNbBytes( objectName.getNbBytes() ) + objectName.getNbBytes(); // The attributes sequence attributesLength = 0; @@ -261,12 +262,27 @@ if ( value instanceof String ) { String stringValue = (String)value; - localValuesLength += 1 + Length.getNbBytes( stringValue.length() ) + stringValue.getBytes().length; + + try + { + int stringLength = stringValue.getBytes( "UTF-8" ).length; + localValuesLength += 1 + Length.getNbBytes( stringLength ) + stringLength; + } + catch ( UnsupportedEncodingException uee ) + { + // Should not be possible. The encoding of the Attribute value + // will check that this value is valid, and if not, it will throw + // an exception. + // The allocated length will be set to a null length value + // in order to avoid an exception thrown while encoding the + // Attribute value. + localValuesLength += 1 + 1; + } } else if ( value instanceof OctetString ) { OctetString octetStringValue = (OctetString)value; - localValuesLength += 1 + Length.getNbBytes( octetStringValue.getValue().length ) + octetStringValue.getLength(); + localValuesLength += 1 + Length.getNbBytes( octetStringValue.getNbBytes() ) + octetStringValue.getNbBytes(); } else { @@ -338,7 +354,7 @@ buffer.put( Length.getBytes( searchResultEntryLength ) ) ; // The objectName - Value.encode( buffer, objectName ); + Value.encode( buffer, objectName.getBytes() ); // The attributes sequence buffer.put( UniversalTag.SEQUENCE_TAG ); @@ -392,7 +408,6 @@ } } } - } catch (NamingException ne) { Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultReference.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultReference.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultReference.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SearchResultReference.java Sun Oct 9 06:49:07 2005 @@ -16,7 +16,6 @@ */ package org.apache.asn1new.ldap.pojo; -import org.apache.asn1new.Asn1Object; import org.apache.asn1.codec.EncoderException; import org.apache.asn1new.ber.tlv.Length; import org.apache.asn1new.ber.tlv.Value; @@ -113,7 +112,7 @@ // We may have more than one reference. while (referencesIterator.hasNext()) { - int ldapUrlLength = ((LdapURL)referencesIterator.next()).getLength(); + int ldapUrlLength = ((LdapURL)referencesIterator.next()).getNbBytes(); searchResultReferenceLength += 1 + Length.getNbBytes( ldapUrlLength ) + ldapUrlLength; } @@ -154,7 +153,7 @@ LdapURL reference = ((LdapURL)referencesIterator.next()); // Encode the reference - Value.encode( buffer, reference ); + Value.encode( buffer, reference.getString() ); } } catch ( BufferOverflowException boe ) Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SimpleAuthentication.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SimpleAuthentication.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SimpleAuthentication.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/SimpleAuthentication.java Sun Oct 9 06:49:07 2005 @@ -77,7 +77,7 @@ */ public int computeLength() { - int length = 1 + Length.getNbBytes( simple.getLength() ) + simple.getLength(); + int length = 1 + Length.getNbBytes( simple.getNbBytes() ) + simple.getNbBytes(); if ( log.isDebugEnabled() ) { @@ -109,7 +109,7 @@ { // The simpleAuthentication Tag buffer.put( (byte)LdapConstants.BIND_REQUEST_SIMPLE_TAG ); - buffer.put( Length.getBytes( simple.getLength() ) ) ; + buffer.put( Length.getBytes( simple.getNbBytes() ) ) ; buffer.put( simple.getValue() ) ; } catch ( BufferOverflowException boe ) Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/AttributeValueAssertionFilter.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/AttributeValueAssertionFilter.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/AttributeValueAssertionFilter.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/AttributeValueAssertionFilter.java Sun Oct 9 06:49:07 2005 @@ -125,7 +125,7 @@ avaLength = 1 + Length.getNbBytes( attributeDescLength ) + attributeDescLength; - int assertionValueLength = assertion.getAssertionValue().getLength(); + int assertionValueLength = assertion.getAssertionValue().getNbBytes(); avaLength += 1 + Length.getNbBytes( assertionValueLength ) + assertionValueLength; Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ConnectorFilter.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ConnectorFilter.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ConnectorFilter.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ConnectorFilter.java Sun Oct 9 06:49:07 2005 @@ -58,12 +58,12 @@ public void addFilter( Filter filter ) throws DecoderException { - if ( this.filterSet == null ) + if ( filterSet == null ) { - this.filterSet = new ArrayList(); + filterSet = new ArrayList(); } - this.filterSet.add( filter ); + filterSet.add( filter ); } /** Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ExtensibleMatchFilter.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ExtensibleMatchFilter.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ExtensibleMatchFilter.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/ExtensibleMatchFilter.java Sun Oct 9 06:49:07 2005 @@ -191,17 +191,17 @@ { if ( matchingRule != null ) { - matchingRuleAssertionLength = 1 + Length.getNbBytes( matchingRule.getLength() ) + matchingRule.getLength(); + matchingRuleAssertionLength = 1 + Length.getNbBytes( matchingRule.getNbBytes() ) + matchingRule.getNbBytes(); } if ( type != null ) { - matchingRuleAssertionLength += 1 + Length.getNbBytes( type.getLength() ) + type.getLength(); + matchingRuleAssertionLength += 1 + Length.getNbBytes( type.getNbBytes() ) + type.getNbBytes(); } if ( matchValue != null ) { - matchingRuleAssertionLength += 1 + Length.getNbBytes( matchValue.getLength() ) + matchValue.getLength(); + matchingRuleAssertionLength += 1 + Length.getNbBytes( matchValue.getNbBytes() ) + matchValue.getNbBytes(); } if ( dnAttributes == true ) @@ -260,23 +260,23 @@ if ( matchingRule != null ) { buffer.put( (byte)LdapConstants.SEARCH_MATCHING_RULE_TAG ); - buffer.put( Length.getBytes( matchingRule.getLength() ) ); - buffer.put( matchingRule.getData() ); + buffer.put( Length.getBytes( matchingRule.getNbBytes() ) ); + buffer.put( matchingRule.getBytes() ); } // The type if ( type != null ) { buffer.put( (byte)LdapConstants.SEARCH_TYPE_TAG ); - buffer.put( Length.getBytes( type.getLength() ) ); - buffer.put( type.getData() ); + buffer.put( Length.getBytes( type.getNbBytes() ) ); + buffer.put( type.getBytes() ); } // The match value if ( matchValue != null ) { buffer.put( (byte)LdapConstants.SEARCH_MATCH_VALUE_TAG ); - buffer.put( Length.getBytes( matchValue.getLength() ) ); + buffer.put( Length.getBytes( matchValue.getNbBytes() ) ); buffer.put( matchValue.getValue() ); } Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/PresentFilter.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/PresentFilter.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/PresentFilter.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/PresentFilter.java Sun Oct 9 06:49:07 2005 @@ -80,7 +80,7 @@ */ public int computeLength() { - return 1 + Length.getNbBytes( attributeDescription.getLength() ) + attributeDescription.getLength(); + return 1 + Length.getNbBytes( attributeDescription.getNbBytes() ) + attributeDescription.getNbBytes(); } /** @@ -104,8 +104,8 @@ { // The PresentFilter Tag buffer.put( (byte)LdapConstants.PRESENT_FILTER_TAG ); - buffer.put( Length.getBytes( attributeDescription.getLength() ) ); - buffer.put( attributeDescription.getData() ); + buffer.put( Length.getBytes( attributeDescription.getNbBytes() ) ); + buffer.put( attributeDescription.getBytes() ); } catch ( BufferOverflowException boe ) { Modified: directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/SubstringFilter.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/SubstringFilter.java?rev=307430&r1=307429&r2=307430&view=diff ============================================================================== --- directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/SubstringFilter.java (original) +++ directory/shared/ldap/trunk/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/filters/SubstringFilter.java Sun Oct 9 06:49:07 2005 @@ -192,12 +192,12 @@ public int computeLength() { // The type - substringsFilterLength = 1 + Length.getNbBytes( type.getLength() ) + type.getLength(); + substringsFilterLength = 1 + Length.getNbBytes( type.getNbBytes() ) + type.getNbBytes(); substringsFilterSequenceLength = 0; if ( initialSubstrings != null ) { - substringsFilterSequenceLength += 1 + Length.getNbBytes( initialSubstrings.getLength() ) + initialSubstrings.getLength(); + substringsFilterSequenceLength += 1 + Length.getNbBytes( initialSubstrings.getNbBytes() ) + initialSubstrings.getNbBytes(); } if ( anySubstrings != null) @@ -207,13 +207,13 @@ while ( anyIterator.hasNext() ) { LdapString any = (LdapString)anyIterator.next(); - substringsFilterSequenceLength += 1 + Length.getNbBytes( any.getLength() ) + any.getLength(); + substringsFilterSequenceLength += 1 + Length.getNbBytes( any.getNbBytes() ) + any.getNbBytes(); } } if ( finalSubstrings != null ) { - substringsFilterSequenceLength += 1 + Length.getNbBytes( finalSubstrings.getLength() ) + finalSubstrings.getLength(); + substringsFilterSequenceLength += 1 + Length.getNbBytes( finalSubstrings.getNbBytes() ) + finalSubstrings.getNbBytes(); } substringsFilterLength += 1 + Length.getNbBytes( substringsFilterSequenceLength ) + substringsFilterSequenceLength; @@ -255,7 +255,7 @@ buffer.put( Length.getBytes( substringsFilterLength ) ); // The type - Value.encode( buffer, type ); + Value.encode( buffer, type.getBytes() ); // The SubstringSequenceFilter Tag buffer.put( UniversalTag.SEQUENCE_TAG ); @@ -273,8 +273,8 @@ if ( initialSubstrings != null ) { buffer.put( (byte)LdapConstants.SEARCH_SUBSTRINGS_INITIAL_TAG ); - buffer.put( Length.getBytes( initialSubstrings.getLength() ) ); - buffer.put( initialSubstrings.getData() ); + buffer.put( Length.getBytes( initialSubstrings.getNbBytes() ) ); + buffer.put( initialSubstrings.getBytes() ); } // The any substrings @@ -286,8 +286,8 @@ { LdapString any = (LdapString)anyIterator.next(); buffer.put( (byte)LdapConstants.SEARCH_SUBSTRINGS_ANY_TAG ); - buffer.put( Length.getBytes( any.getLength() ) ); - buffer.put( any.getData() ); + buffer.put( Length.getBytes( any.getNbBytes() ) ); + buffer.put( any.getBytes() ); } } @@ -295,8 +295,8 @@ if ( finalSubstrings != null ) { buffer.put( (byte)LdapConstants.SEARCH_SUBSTRINGS_FINAL_TAG ); - buffer.put( Length.getBytes( finalSubstrings.getLength() ) ); - buffer.put( finalSubstrings.getData() ); + buffer.put( Length.getBytes( finalSubstrings.getNbBytes() ) ); + buffer.put( finalSubstrings.getBytes() ); } } catch ( BufferOverflowException boe )