Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

binary fields can be 'key'

  • Loading branch information...
commit 74d306c71e39ebe38788638c741e48d1909a0f60 1 parent c2aecf9
Alejandro Revilla ar authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 jpos/src/main/java/org/jpos/util/FSDMsg.java
8 jpos/src/main/java/org/jpos/util/FSDMsg.java
View
@@ -369,7 +369,7 @@ protected void pack (Element schema, StringBuffer sb)
sb.append(c);
}
if (key) {
- keyOff = keyOff + normalizeKeyValue(value, properties);
+ keyOff = keyOff + normalizeKeyValue(type, value, properties);
defaultKey += elem.getAttributeValue ("default-key");
}
}
@@ -389,7 +389,9 @@ private Map loadProperties(Element elem) {
return props;
}
- private String normalizeKeyValue(String value, Map properties) {
+ private String normalizeKeyValue(String type, String value, Map properties) throws UnsupportedEncodingException {
+ if (isBinary(type))
+ value = ISOUtil.hexString(value.getBytes(ISOUtil.ENCODING));
if (properties.containsKey(value)) {
return (String) properties.get(value);
}
@@ -419,7 +421,7 @@ protected void unpack (InputStream is, Element schema)
is, id, length, type, separator );
if (key) {
- keyOff = keyOff + normalizeKeyValue(value, properties);
+ keyOff = keyOff + normalizeKeyValue(type, value, properties);
defaultKey += elem.getAttributeValue ("default-key");
}
if ("K".equals(type) && !value.equals (elem.getText()))
Please sign in to comment.
Something went wrong with that request. Please try again.