use of com.adaptris.util.text.ByteTranslator in project interlok by adaptris.
the class HexSequenceConfiguredReplacementSource method obtainValue.
public String obtainValue(AdaptrisMessage msg) throws ServiceException {
String result = null;
ByteTranslator hexToBytes = new HexStringByteTranslator();
ByteTranslator bytesToString = new SimpleByteTranslator();
if (!isEmpty(charset)) {
bytesToString = new CharsetByteTranslator(charset);
}
try {
result = bytesToString.translate(hexToBytes.translate(this.getValue()));
} catch (Exception e) {
throw new ServiceException(e);
}
return result;
}
use of com.adaptris.util.text.ByteTranslator in project interlok by adaptris.
the class StringToHexService method reformat.
@Override
public String reformat(String s, String msgCharset) throws Exception {
ByteTranslator bytesToHex = new HexStringByteTranslator();
ByteTranslator stringToBytes = new CharsetByteTranslator(getCharacterEncoding());
return bytesToHex.translate(stringToBytes.translate(s));
}
use of com.adaptris.util.text.ByteTranslator in project interlok by adaptris.
the class HexToStringService method reformat.
@Override
public String reformat(String s, String msgCharset) throws Exception {
ByteTranslator hexToBytes = new HexStringByteTranslator();
ByteTranslator bytesToString = new CharsetByteTranslator(getCharacterEncoding());
return bytesToString.translate(hexToBytes.translate(s));
}
Aggregations