{
val = new StringValue( attributeType, Strings.utf8ToString( ( byte[] ) value ) );
}
else
{
throw new LdapException( I18n.err( I18n.ERR_309, oid ) );
}
}
else
{
if ( value instanceof String )
{
val = new BinaryValue( attributeType, Strings.getBytesUtf8( ( String ) value ) );
}
else if ( value instanceof byte[] )
{
val = new BinaryValue( attributeType, ( byte[] ) value );
}
else
{
throw new LdapException( I18n.err( I18n.ERR_309, oid ) );
}
}
return val;
}