diff options
author | Mamadou DIOP <bossiel@yahoo.fr> | 2015-08-17 01:56:35 +0200 |
---|---|---|
committer | Mamadou DIOP <bossiel@yahoo.fr> | 2015-08-17 01:56:35 +0200 |
commit | 631fffee8a28b1bec5ed1f1d26a20e0135967f99 (patch) | |
tree | 74afe3bf3efe15aa82bcd0272b2b0f4d48c2d837 /branches/1.0/bindings/java/java.i | |
parent | 7908865936604036e6f200f1b5e069f8752f3a3a (diff) | |
download | doubango-631fffee8a28b1bec5ed1f1d26a20e0135967f99.zip doubango-631fffee8a28b1bec5ed1f1d26a20e0135967f99.tar.gz |
-
Diffstat (limited to 'branches/1.0/bindings/java/java.i')
-rw-r--r-- | branches/1.0/bindings/java/java.i | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/branches/1.0/bindings/java/java.i b/branches/1.0/bindings/java/java.i deleted file mode 100644 index 6872e59..0000000 --- a/branches/1.0/bindings/java/java.i +++ /dev/null @@ -1,79 +0,0 @@ -/* File : java.i
-* http://www.swig.org/Doc1.3/Java.html
-*/
-
-// http://www.swig.org/Doc1.3/Java.html#enumerations
-%include "enums.swg"
-%javaconst(1);
-
-
-//================== Mapping void* (Java to C) as ByteBuffer -%typemap(jni) void * "jbyteArray" -%typemap(jtype) void * "java.nio.ByteBuffer" -%typemap(jstype) void * "java.nio.ByteBuffer" -%typemap(javain) void * "$javainput" -%typemap(javaout) void * { return $jnicall; } - -// (From Java to C) -%typemap(in) void * %{ - $1 = jenv->GetDirectBufferAddress($input); -%} - -// (From C to Java) -//%typemap(out) void * %{ -// $result = $1; -//%} -%typemap(javadirectorin) void * "$jniinput" -//==================
-
-
-%typemap(javacode) SipMessage %{
- public byte[] getSipContent() {
- final int clen = (int)this.getSipContentLength();
- if(clen>0){
- final java.nio.ByteBuffer buffer = java.nio.ByteBuffer.allocateDirect(clen);
- final int read = (int)this.getSipContent(buffer, clen);
- final byte[] bytes = new byte[read];
- buffer.get(bytes, 0, read);
- return bytes;
- }
- return null;
- }
-%}
-
-%typemap(javacode) SipSession %{
- protected java.nio.ByteBuffer getByteBuffer(byte[] bytes) {
- if(bytes != null){
- final java.nio.ByteBuffer byteBuffer = java.nio.ByteBuffer.allocateDirect(bytes.length);
- byteBuffer.put(bytes);
- return byteBuffer;
- }
- return null;
- }
-%}
-
-%typemap(javacode) PublicationSession %{
- public boolean Publish(byte[] bytes) {
- if(bytes != null){
- final java.nio.ByteBuffer byteBuffer = this.getByteBuffer(bytes);
- return this.publish(byteBuffer, bytes.length);
- }
- return false;
- }
-%}
-
-%typemap(javacode) XcapMessage %{
- public byte[] getXcapContent() {
- final int clen = (int)this.getXcapContentLength();
- if(clen>0){
- final java.nio.ByteBuffer buffer = java.nio.ByteBuffer.allocateDirect(clen);
- final int read = (int)this.getXcapContent(buffer, clen);
- final byte[] bytes = new byte[read];
- buffer.get(bytes, 0, read);
- return bytes;
- }
- return null;
- }
-%}
-
-%include ../_common/tinyWRAP.i
|