Mi pare ci sia, adesso provo se fa al caso mio.ByteConverter dovrebbe avere un metodo per la copia di un array. Dai un'occhiata.
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
bt_printer_addbuffer_writeline (B4A line: 125)
BC.ArrayCopy(TB,0,BufferByte,BufferByte.Length,TB.Length)
java.lang.ArrayIndexOutOfBoundsException: src.length=17 srcPos=0 dst.length=0 dstPos=0 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:273)
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)
at b4a.example.main.afterFirstLayout(main.java:102)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5297)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
java.lang.ArrayIndexOutOfBoundsException: src.length=17 srcPos=0 dst.length=0 dstPos=0 length=17
BC.ArrayCopy(B,0,BufferByte,BufferByte.Length-1,B.Length)
Logger connesso a: 0123456789ABCDEF
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
bt_printer_addbuffer_writeline (B4A line: 124)
BC.ArrayCopy(B,0,BufferByte,BufferByte.Length-1,B
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)
at b4a.example.main.afterFirstLayout(main.java:102)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5297)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
BufferByte=Merge(BufferByte,Text.GetBytes(mEncoding))
private Sub Merge(Array1() As Byte, Array2() As Byte) As Object
Private BC As ByteConverter
Dim ByteArray(Array1.Length + Array2.Length) As Byte
BC.ArrayCopy(Array1,0,ByteArray,0,Array1.Length)
BC.ArrayCopy(Array2,0,ByteArray,Array1.Length,Array2.Length)
Return ByteArray
End Sub
private Sub Merge(Array1() As Byte, Array2() As Byte) As Object
Dim ByteArray(Array1.Length + Array2.Length) As Byte
For i=0 To Array1.Length-1
ByteArray(i)=Array1(i)
Next
For i=0 To Array2.Length-1
ByteArray(Array1.Length+i)=Array2(i)
Next
Return ByteArray
End Sub
Siine felice (riuscirà Google a tradurre "Siine"? Non ci riuscirebbero nemmeno tanti italiani ).Sono sincero, è la soluzione che avrei proposto io se non avessi i messaggi bloccati (senza motivo)