I am new to Scala and work currently on a project involving both Java and a Scala modules. Now I'd like to call a Scala method from Java using a parameter of type byte[].
The Scala method has the signature: def foo(data: Array[Byte])
The Java call looks like this: foo(x), where x has the type byte[].
The IDE tells me its not possible:
The method foo(Array) in the type Bar is not applicable for the arguments (byte[])
As an additional constraint it is not preferred to change the Scala method. On the Java side I tried using Byte[], but this didn't solve the problem. There must exist some conversion?
Array[Byte]isbyte[]as of 2.8, so if your IDE is complaining your IDE is wrong.foo(x)from Java with x of type (raw)scala.Arraylets my IDE return:The method foo(byte[]) in the type Bar is not applicable for the arguments (Array). Thats what i would call contradictory behaviour. I should try to compile the code somewhere else...