小编jub*_*lop的帖子

IntelliJ“忽略 inputstream.read 的结果”-如何解决?

我正在修复我的应用程序中的一些潜在错误。我正在使用声纳来评估我的代码。我的问题是这样的:

private Cipher readKey(InputStream re) throws Exception {
    byte[] encodedKey = new byte[decryptBuferSize];
    re.read(encodedKey); //Check the return value of the "read" call to see how many bytes were read. (the issue I get from Sonar)


    byte[] key = keyDcipher.doFinal(encodedKey);
    Cipher dcipher = ConverterUtils.getAesCipher();
    dcipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(key, "AES"));
    return dcipher;
}
Run Code Online (Sandbox Code Playgroud)

这是否意味着字节数组为空?为什么会被忽略?我从来没有使用过字节,所以我想知道这个问题究竟意味着什么以及我如何解决它。感谢您的帮助!

java bytearray inputstream intellij-idea

4
推荐指数
1
解决办法
6435
查看次数

标签 统计

bytearray ×1

inputstream ×1

intellij-idea ×1

java ×1