/** * Converts the given HTML code according to the settings of this converter.<p> * * @param htmlInput HTML input stored in an array of bytes * @return array of bytes containing the converted HTML * * @throws UnsupportedEncodingException if the encoding set for the conversion is not supported */ public byte[] convertToByte(byte[] htmlInput) throws UnsupportedEncodingException { return convertToByte(new String(htmlInput, getEncoding())); }
/** * Converts the given HTML code according to the settings of this converter.<p> * * @param htmlInput HTML input stored in an array of bytes * @return array of bytes containing the converted HTML * * @throws UnsupportedEncodingException if the encoding set for the conversion is not supported */ public byte[] convertToByte(byte[] htmlInput) throws UnsupportedEncodingException { return convertToByte(new String(htmlInput, getEncoding())); }
/** * Converts the given HTML code according to the settings of this converter.<p> * * If an any error occurs during the conversion process, the original input is returned unmodified.<p> * * @param htmlInput HTML input stored in an array of bytes * @return array of bytes containing the converted HTML */ public byte[] convertToByteSilent(byte[] htmlInput) { try { return convertToByte(htmlInput); } catch (Exception e) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e); } return htmlInput; } }
/** * Converts the given HTML code according to the settings of this converter.<p> * * If an any error occurs during the conversion process, the original input is returned unmodified.<p> * * @param htmlInput HTML input stored in an array of bytes * @return array of bytes containing the converted HTML */ public byte[] convertToByteSilent(byte[] htmlInput) { try { return convertToByte(htmlInput); } catch (Exception e) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e); } return htmlInput; } }
/** * Converts the given HTML code according to the settings of this converter.<p> * * If an any error occurs during the conversion process, the original input is returned unmodified.<p> * * @param htmlInput HTML input stored in a string * @return array of bytes containing the converted HTML */ public byte[] convertToByteSilent(String htmlInput) { try { return convertToByte(htmlInput.getBytes(getEncoding())); } catch (Exception e) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e); } try { return htmlInput.getBytes(getEncoding()); } catch (UnsupportedEncodingException e1) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e1); } return htmlInput.getBytes(); } } }
/** * Converts the given HTML code according to the settings of this converter.<p> * * If an any error occurs during the conversion process, the original input is returned unmodified.<p> * * @param htmlInput HTML input stored in a string * @return array of bytes containing the converted HTML */ public byte[] convertToByteSilent(String htmlInput) { try { return convertToByte(htmlInput.getBytes(getEncoding())); } catch (Exception e) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e); } try { return htmlInput.getBytes(getEncoding()); } catch (UnsupportedEncodingException e1) { if (LOG.isWarnEnabled()) { LOG.warn(Messages.get().getBundle().key(Messages.LOG_CONVERSION_BYTE_FAILED_0), e1); } return htmlInput.getBytes(); } } }