Vincent Chen
09/04/2019, 5:53 PM.....
var outputLength = cValuesOf(0)
......
val outputBA = outputData.readBytes(outputLength convert int)
How to Convert outputLength to Int
ThanksDominaezzz
09/04/2019, 6:20 PMoutputLength[0].toInt()
?Cyrille QUÉMIN
09/05/2019, 1:13 PMconvert()
it deals with platform specific length of native type like int 32 or int 64:
val outputBA = outputData.readBytes(outputLength.convert())
And there is no overhead since this is resolved at compilation time if I remember properly.Cyrille QUÉMIN
09/05/2019, 3:38 PMcvalueOf()
you can use this straight away with convert()
. Instead of:
.....
var outputLength = cValuesOf(myLength)
......
val outputBA = outputData.readBytes(outputLength convert int)
you can perhaps try :
......
val outputBA = outputData.readBytes(myLength.convert())