src/main/java/org/nustaq/offheap/structs/FSTStruct.java
public <T extends FSTStruct> T detachTo(T pointer) {
        if ( pointer == null ) {
            return detach();
        }
        if (isOffHeap()) {
            pointer.___fac = ___fac;
            pointer.___bytes = ___bytes;
            pointer.___elementSize = ___elementSize;
            pointer.___offset = ___offset;
            return pointer;
        }
        return (T) this;
    }
public <T extends FSTStruct> T detachTo(T pointer) {
        if ( pointer == null ) {
            return detach();
        }
        if (isOffHeap()) {
            pointer.___fac = ___fac;
            pointer.___bytes = ___bytes;
            pointer.___elementSize = ___elementSize;
            pointer.___offset = ___offset;
            return pointer;
        }
        return (T) this;
    }
public < T extends FSTStruct > T detachTo ( T pointer ) { if ( pointer == null ) { return detach ( ) ; } if ( isOffHeap ( ) ) { pointer . ___fac = ___fac ; pointer . ___bytes = ___bytes ; pointer . ___elementSize = ___elementSize ; pointer . ___offset = ___offset ; return pointer ; } return ( T ) this ; }
move offsets and memorybase to given pointer and return the pointer.
Eases dereferencing of nested structs without object creation.
If the given pointer is null, a new one will be created (alloc)
<pre>
MyStruct st = FSTStructFactory.getInstance().createEmptyStructPointer(FSTStruct.class);
otherStruct.getEmbeddedMyStruct().to(st);
</pre>
move offsets and memorybase to given pointer and return the pointer . Eases dereferencing of nested structs without object creation . If the given pointer is null a new one will be created ( alloc ) <pre > MyStruct st = FSTStructFactory . getInstance () . createEmptyStructPointer ( FSTStruct . class ) ; otherStruct . getEmbeddedMyStruct () . to ( st ) ; < / pre >