code: public static boolean streq(byte[] data, String str)
      {
          if (data == null) {
              return false;
          }
          return new String(data, ZMQ.CHARSET).compareTo(str) == 0;
      }
docs: String equals.
  Uses String compareTo for the comparison (lexigraphical)
  @param str String to compare with data
  @param data the binary data to compare
  @return True if data matches given string