【发布时间】:2016-10-30 00:48:23
【问题描述】:
我正在努力修复我的应用程序中的一些潜在错误。我正在使用 Sonar 来评估我的代码。我的问题是这样的:
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;
}
这是否意味着字节数组为空?为什么会被忽略? 我从来没有使用过字节,所以我想知道这个问题到底意味着什么以及如何解决它。感谢您的帮助!
【问题讨论】:
标签: java intellij-idea bytearray inputstream