/**
  * Get value(s) whilst removing any trailing nulls
  *
  * @return
  */
 public String getValueWithoutTrailingNull() {
   List<String> values = splitByNullSeperator((String) value);
   StringBuffer sb = new StringBuffer();
   for (int i = 0; i < values.size(); i++) {
     if (i != 0) {
       sb.append("\u0000");
     }
     sb.append(values.get(i));
   }
   return sb.toString();
 }
Ejemplo n.º 2
0
  private int putDBRegex(String name, DBRegex regex) {

    int start = _buf.position();
    _put(REGEX, name);
    _put(regex.getPattern());

    String options = regex.getOptions();

    TreeMap<Character, Character> sm = new TreeMap<Character, Character>();

    for (int i = 0; i < options.length(); i++) {
      sm.put(options.charAt(i), options.charAt(i));
    }

    StringBuffer sb = new StringBuffer();

    for (char c : sm.keySet()) {
      sb.append(c);
    }

    _put(sb.toString());
    return _buf.position() - start;
  }