我正在修复我的应用程序中的一些潜在错误。我正在使用声纳来评估我的代码。我的问题是这样的:
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)
这是否意味着字节数组为空?为什么会被忽略?我从来没有使用过字节,所以我想知道这个问题究竟意味着什么以及我如何解决它。感谢您的帮助!