java 代码 字符串处理 疑惑求解

 public static final void addField(String str, boolean z, String str2, boolean z2) throws IOException {
        if (str == null) {
            throw new NullPointerException("name");
        } else if (str2 != null) {
            if (content.size() > 0) {
                content.write(38);
            }
            String str3 = "UTF-8";
            if (z) {
                try {
                    str = URLEncoder.encode(str, str3);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            if (z2) {
                str2 = URLEncoder.encode(str2, str3);
            }
            content.write(str.getBytes(str3));
            content.write(61);
            content.write(str2.getBytes(str3));
        } else {
            throw new NullPointerException("value");
        }
    }

这个代码里面的 content.write(61); 我打印了结果 和我穿进去的字符串结果是一样的,请问这里的61有什么用呢?

阅读 1.8k
2 个回答

代码是反编译的吧? ascii 38 是 &字符,61是 =,这就是在拼URL参数而已。

content存的应该是字符对应的字节,61对应的应该是=号

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题