CPKIFBuffer.java
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 package com.orionsec.jpkif;
00010
00011 public class CPKIFBuffer {
00012 private long swigCPtr;
00013 protected boolean swigCMemOwn;
00014
00015 public CPKIFBuffer(long cPtr, boolean cMemoryOwn) {
00016 swigCMemOwn = cMemoryOwn;
00017 swigCPtr = cPtr;
00018 }
00019
00020 public static long getCPtr(CPKIFBuffer obj) {
00021 return (obj == null) ? 0 : obj.swigCPtr;
00022 }
00023
00024 protected void finalize() {
00025 delete();
00026 }
00027
00028 public synchronized void delete() {
00029 if (swigCPtr != 0) {
00030 if (swigCMemOwn) {
00031 swigCMemOwn = false;
00032 pkif_moduleJNI.delete_CPKIFBuffer(swigCPtr);
00033 }
00034 swigCPtr = 0;
00035 }
00036 }
00037
00038 public CPKIFBuffer() {
00039 this(pkif_moduleJNI.new_CPKIFBuffer__SWIG_0(), true);
00040 }
00041
00042 public CPKIFBuffer(byte[] buf, long bufLen) {
00043 this(pkif_moduleJNI.new_CPKIFBuffer__SWIG_1(buf, bufLen), true);
00044 }
00045
00046 public CPKIFBuffer(boolean takeOwnership, byte[] buf, long bufLen) {
00047 this(pkif_moduleJNI.new_CPKIFBuffer__SWIG_2(takeOwnership, buf, bufLen), true);
00048 }
00049
00050 public CPKIFBuffer(CPKIFBuffer data) {
00051 this(pkif_moduleJNI.new_CPKIFBuffer__SWIG_3(CPKIFBuffer.getCPtr(data), data), true);
00052 }
00053
00054 public byte[] AllocateBuffer(int len) {
00055 byte[] ret = pkif_moduleJNI.CPKIFBuffer_AllocateBuffer(swigCPtr, this, len);
00056 return ret;
00057 }
00058
00059 public byte[] GetBuffer() {
00060 byte[] ret = pkif_moduleJNI.CPKIFBuffer_GetBuffer(swigCPtr, this);
00061 return ret;
00062 }
00063
00064 public long GetLength() {
00065 return pkif_moduleJNI.CPKIFBuffer_GetLength(swigCPtr, this);
00066 }
00067
00068 }