normalizedValue = normalizer.normalize( this ).getBytes(); normalized = true; same = Arrays.equals( wrappedValue, normalizedValue );
/** * Get a String representation of a Compare Request * * @return A Compare Request String */ public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " Compare request\n" ); sb.append( " Entry : '" ).append( name.toString() ).append( "'\n" ); sb.append( " Attribute description : '" ).append( attrId ).append( "'\n" ); sb.append( " Attribute value : '" ); if ( !attrVal.isBinary() ) { sb.append( attrVal.get() ); } else { byte[] binVal = attrVal.getBytes(); sb.append( StringTools.utf8ToString( binVal ) ).append( '/' ).append( StringTools.dumpBytes( binVal ) ).append( "'\n" ); } return sb.toString(); } }
sb.append( " " ).append( StringTools.dumpBytes( value.getBytes() ) ).append('\n' );
byte[] binaryVal = val.getBytes(); removed &= values.remove( new StringValue( StringTools.utf8ToString( binaryVal ) ) );
+ StringTools.dumpHexPairs( normValue .getBytes() );
sb.append( " " ).append( StringTools.dumpBytes( value.getBytes() ) ).append('\n' );
public Class<?> findClass( String name ) throws ClassNotFoundException { byte[] classBytes = null; Value<?> value = attribute.get(); if ( value.isBinary() ) { classBytes = value.getBytes(); return defineClass( name, classBytes, 0, classBytes.length ); } else { throw new ClassNotFoundException( I18n.err( I18n.ERR_10002 ) ); } } }
public Value<?> normalize( Value<?> value ) throws LdapException { if ( value.isBinary() ) { byte[] val = value.getBytes(); // each byte will be changed to be > 0, and spaces will be trimmed byte[] newVal = new byte[ val.length ]; int i = 0; for ( byte b:val ) { newVal[i++] = (byte)(b & 0x007F); } return new BinaryValue( StringTools.trim( newVal ) ); } throw new IllegalStateException( I18n.err( I18n.ERR_474 ) ); }
char[] encoded = Base64.encode( value.getBytes() );
/** * <p> * Get the byte[] value, if and only if the value is known to be Binary, * otherwise a InvalidAttributeValueException will be thrown * </p> * <p> * Note that this method returns the first value only. * </p> * * @return The value as a byte[] * @throws LdapInvalidAttributeValueException If the value is a String */ public byte[] getBytes() throws LdapInvalidAttributeValueException { Value<?> value = get(); if ( value.isBinary() ) { return value.getBytes(); } else { String message = I18n.err( I18n.ERR_04130 ); LOG.error( message ); throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, message ); } }
byte[] bytes = matchValue.getBytes(); int bytesLength = bytes.length; buffer.put( TLV.getBytes( bytesLength ) );
normName = atav.getNormType() + "=#" + StringTools.dumpHexPairs( atav.getNormValue().getBytes() );
byte[] binaryVal = val.getBytes();
assertionValueLength = assertionValue.getBytes().length;
/** * Convert the ServerAttribute to a ClientAttribute * * @return An instance of ClientAttribute */ public EntryAttribute toClientAttribute() { // Create the new EntryAttribute EntryAttribute clientAttribute = new DefaultClientAttribute( upId ); // Copy the values for ( Value<?> value:this ) { Value<?> clientValue = null; if ( value instanceof StringValue ) { clientValue = new StringValue( value.getString() ); } else { clientValue = new BinaryValue( value.getBytes() ); } clientAttribute.add( clientValue ); } return clientAttribute; }
binaryValue = new BinaryValue( attributeType, val.getBytes() );
Value.encode( buffer, assertion.getAssertionValue().getBytes() );
int bytesLength = matchValue.getBytes().length; extensibleMatchLength += 1 + TLV.getNbBytes( bytesLength ) + bytesLength;