Exemple #1
0
 private static byte[] decodeXAttrValue(String value) throws IOException {
   if (value != null) {
     return XAttrCodec.decodeValue(value);
   } else {
     return new byte[0];
   }
 }
Exemple #2
0
  private static Map<String, Object> toJsonMap(final XAttr xAttr, final XAttrCodec encoding)
      throws IOException {
    if (xAttr == null) {
      return null;
    }

    final Map<String, Object> m = new TreeMap<String, Object>();
    m.put("name", XAttrHelper.getPrefixName(xAttr));
    m.put(
        "value",
        xAttr.getValue() != null ? XAttrCodec.encodeValue(xAttr.getValue(), encoding) : null);
    return m;
  }