src/org/jnetpcap/nio/JMemory.java
protected boolean transferOwnership(JMemory memory) {
		if (!memory.owner || this.physical == 0 || this.physical != memory.physical) {
			return false;
		}

		memory.owner = false;
		this.owner = true;
		this.keeper = null; // Release any kept references

		if (this.ref != null) {
			throw new IllegalStateException(
					"Can not transfer ownership when already own memory");
		}
		this.ref = createReference(memory.ref.address, memory.ref.size);

		memory.ref.remove();
		memory.ref = null;

		return true;
	}
/**
	 * A special method that allows one object to transfer ownership of a memory
	 * block. The supplied JMemory object must already be the owner of the memory
	 * block. This policy is strictly enforced. If the ownership transfer
	 * succeeds, this memory object will be responsible for freeing up memory
	 * block when this object is garbage collected or the user calls
	 * JMemory.cleanup() method. <h2>Warning!</h2> Care must be taken to only
	 * transfer ownership for simple memory allocations. If a complex memory
	 * allocation was used, one that sub allocates other memory blocks which are
	 * referenced from the original memory block, to avoid creating memory leaks.
	 * It is best practice to sub allocate other memory blocks using JMemory class
	 * which will properly manage that memory block and ensure that it will freed
	 * properly as well.
	 * 
	 * @param memory
	 *          memory block to transfer the ownership from
	 * @return if tranfer succeeded true is returned, otherwise false.
	 */
A special method that allows one object to transfer ownership of a memory
block. The supplied JMemory object must already be the owner of the memory
block. This policy is strictly enforced. If the ownership transfer
succeeds, this memory object will be responsible for freeing up memory
block when this object is garbage collected or the user calls
JMemory.cleanup() method. Warning! Care must be taken to only
transfer ownership for simple memory allocations. If a complex memory
allocation was used, one that sub allocates other memory blocks which are
referenced from the original memory block, to avoid creating memory leaks.
It is best practice to sub allocate other memory blocks using JMemory class
which will properly manage that memory block and ensure that it will freed
properly as well.

@param memory
memory block to transfer the ownership from
@return if tranfer succeeded true is returned, otherwise false.
A special method that allows one object to transfer ownership of a memory block . The supplied JMemory object must already be the owner of the memory block . This policy is strictly enforced . If the ownership transfer succeeds this memory object will be responsible for freeing up memory block when this object is garbage collected or the user calls JMemory . cleanup () method . Warning! Care must be taken to only transfer ownership for simple memory allocations . If a complex memory allocation was used one that sub allocates other memory blocks which are referenced from the original memory block to avoid creating memory leaks . It is best practice to sub allocate other memory blocks using JMemory class which will properly manage that memory block and ensure that it will freed properly as well . @param memory memory block to transfer the ownership from @return if tranfer succeeded true is returned otherwise false .
protected boolean transferOwnership(JMemory memory) {
		if (!memory.owner || this.physical == 0 || this.physical != memory.physical) {
			return false;
		}
		memory.owner = false;
		this.owner = true;
		this.keeper = null; 
		if (this.ref != null) {
			throw new IllegalStateException(
					"Can not transfer ownership when already own memory");
		}
		this.ref = createReference(memory.ref.address, memory.ref.size);
		memory.ref.remove();
		memory.ref = null;
		return true;
	}
protected boolean transferOwnership ( JMemory memory ) { if ( ! memory . owner || this . physical == 0 || this . physical != memory . physical ) { return false ; } memory . owner = false ; this . owner = true ; this . keeper = null ; if ( this . ref != null ) { throw new IllegalStateException ( "Can not transfer ownership when already own memory" ) ; } this . ref = createReference ( memory . ref . address , memory . ref . size ) ; memory . ref . remove ( ) ; memory . ref = null ; return true ; }
A special method that allows one object to transfer ownership of a memory
 block.
A special method that allows one object to transfer ownership of a memory block .
// Release any kept references