I have two Byte Array (or more) and I should merge it into one
This operation I have to repeat it for several Array. At the main Buffer (Byte) I have to add other Byte arrays.
How can it be done?
NOTE:
I have already used the ByteConverter library,
But it does not work and it generates error
B4X:
Dim A() As Byte = Array As Byte(23,45,67)
Dim B() As Byte = Array As Byte(223,1,70)
Dim c() As Byte
c= A & B ' Come si può fare?
' I want to get it: C = (23,45,67,223,1,70)
This operation I have to repeat it for several Array. At the main Buffer (Byte) I have to add other Byte arrays.
How can it be done?
NOTE:
I have already used the ByteConverter library,
B4X:
ByteConverter.ArrayCopy(OtherArray,0,BufferByte,BufferByte.Length-1,OtherArray.Length)
ByteConverter.ArrayCopy(OtherArray,0,BufferByte,BufferByte.Length-1,OtherArray
java.lang.ArrayIndexOutOfBoundsException: src.length=17 srcPos=0 dst.length=0 dstPos=-1 length=17
at java.lang.System.arraycopy(Native Method)
at anywheresoftware.b4a.agraham.byteconverter.ByteConverter.ArrayCopy(ByteConverter.java:227)
at b4a.example.bt_printer._addbuffer_writeline(bt_printer.java:262)
at b4a.example.main._printer(main.java:500)
at b4a.example.main._activity_create(main.java:379)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)