XcapMessage.java 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.9
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. package org.doubango.tinyWRAP;
  9. public class XcapMessage {
  10. private long swigCPtr;
  11. protected boolean swigCMemOwn;
  12. protected XcapMessage(long cPtr, boolean cMemoryOwn) {
  13. swigCMemOwn = cMemoryOwn;
  14. swigCPtr = cPtr;
  15. }
  16. protected static long getCPtr(XcapMessage obj) {
  17. return (obj == null) ? 0 : obj.swigCPtr;
  18. }
  19. protected void finalize() {
  20. delete();
  21. }
  22. public synchronized void delete() {
  23. if (swigCPtr != 0) {
  24. if (swigCMemOwn) {
  25. swigCMemOwn = false;
  26. tinyWRAPJNI.delete_XcapMessage(swigCPtr);
  27. }
  28. swigCPtr = 0;
  29. }
  30. }
  31. public byte[] getXcapContent() {
  32. final int clen = (int)this.getXcapContentLength();
  33. if(clen>0){
  34. final java.nio.ByteBuffer buffer = java.nio.ByteBuffer.allocateDirect(clen);
  35. final int read = (int)this.getXcapContent(buffer, clen);
  36. final byte[] bytes = new byte[read];
  37. buffer.get(bytes, 0, read);
  38. return bytes;
  39. }
  40. return null;
  41. }
  42. public XcapMessage() {
  43. this(tinyWRAPJNI.new_XcapMessage(), true);
  44. }
  45. public short getCode() {
  46. return tinyWRAPJNI.XcapMessage_getCode(swigCPtr, this);
  47. }
  48. public String getPhrase() {
  49. return tinyWRAPJNI.XcapMessage_getPhrase(swigCPtr, this);
  50. }
  51. public String getXcapHeaderValue(String name, long index) {
  52. return tinyWRAPJNI.XcapMessage_getXcapHeaderValue__SWIG_0(swigCPtr, this, name, index);
  53. }
  54. public String getXcapHeaderValue(String name) {
  55. return tinyWRAPJNI.XcapMessage_getXcapHeaderValue__SWIG_1(swigCPtr, this, name);
  56. }
  57. public String getXcapHeaderParamValue(String name, String param, long index) {
  58. return tinyWRAPJNI.XcapMessage_getXcapHeaderParamValue__SWIG_0(swigCPtr, this, name, param, index);
  59. }
  60. public String getXcapHeaderParamValue(String name, String param) {
  61. return tinyWRAPJNI.XcapMessage_getXcapHeaderParamValue__SWIG_1(swigCPtr, this, name, param);
  62. }
  63. public long getXcapContentLength() {
  64. return tinyWRAPJNI.XcapMessage_getXcapContentLength(swigCPtr, this);
  65. }
  66. public long getXcapContent(java.nio.ByteBuffer output, long maxsize) {
  67. return tinyWRAPJNI.XcapMessage_getXcapContent(swigCPtr, this, output, maxsize);
  68. }
  69. }