所以我对Scala并不了解,所以我很少使用ScalaToJava转换器将一些代码转换为Scala。但是现在我遇到了这个错误。 发现[错误]:数组[字节] [错误]必填:字节
def generateAuthTkt(username: String,
tokens: Array[String],
userData: Array[String],
encode: Boolean,
ignoreIP: Boolean,
ip: String,
secretKey: String,
timestampInSeconds: Long): String = {
val username: String =
(if (StringUtils.isBlank(username)) StringUtils.EMPTY else
username)
val tokens: Array[String] = (if (tokens == null) Array() else
tokens)
val userData: Array[String] = (if (userData == null) Array() else
userData)
var ipAddress: String = ip
if (ignoreIP || StringUtils.isBlank(ipAddress)) {
ipAddress = "0.0.0.0"
}
val ipLong: Long = convertIPToLong(ipAddress).longValue()
val ipBytes: Array[Byte] = longToBytes(ipLong)
val tsBytes: Array[Byte] = longToBytes(timestampInSeconds)
val ipts: Array[Byte] = ArrayUtils.addAll(
ArrayUtils.subarray(ipBytes, 4, 8),
ArrayUtils.subarray(tsBytes, 4, 8))
//I am getting the error in the upper line
var dataBytes: Array[Byte] = ArrayUtils.addAll(ipts,
secretKey.getBytes)