if ( clazz == null )
{
throw new IOException( I18n.err( I18n.ERR_597, encodableClass ) );
}
EncoderFactory factory = null;
try
{
factory = ( EncoderFactory ) clazz.newInstance();
}
catch ( IllegalAccessException iae )
{
throw new IOException( I18n.err( I18n.ERR_601, encodableClass ) );
}
catch ( InstantiationException ie )
{
throw new IOException( I18n.err( I18n.ERR_599, encodableClass ) );
}
Encoder encoder = factory.getEncoder();
return encoder.encode( encodable );
}