Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TTM {
- public interface WrapperDLL extends Library {
- WrapperDLL INSTANCE = (WrapperDLL) Native.loadLibrary("TransportRE", WrapperDLL.class);
- int TRE_send(int channel, Pointer data, int len);
- }
- public int Send (int channel, String data, int len) {
- WrapperDLL wdll = WrapperDLL.INSTANCE;
- Memory mem = new Memory(data.length()+1);
- mem.setString(0, data);
- int byteSent = wdll.TRE_send(channel_id, mem.getPointer(0), len);
- // at this (TRE_send) point the VM crashes !!!!
- return byteSent;
- }
- public int Send (int channel, String data, int len) {
- WrapperDLL wdll = WrapperDLL.INSTANCE;
- Memory mem = new Memory(data.length()+1);
- mem.setString(0, data);
- int byteSent = wdll.TRE_send(channel_id, mem, len);
- return byteSent;
- }
- void send(String);
- void send(Pointer);
- void send(MyStructure);
- int byteSent = wdll.TRE_send(channel_id, data.toCharArray(), len);
Add Comment
Please, Sign In to add comment