MCPcopy Index your code
hub / github.com/java-native-access/jna / getByteBuffer

Method getByteBuffer

src/com/sun/jna/Memory.java:588–596  ·  view source on GitHub ↗

Get a ByteBuffer mapped to a portion of this memory. We keep a weak reference to all ByteBuffers provided so that this memory object is not GC'd while there are still implicit outstanding references to it (it'd be nice if we could attach our own reference to the ByteBuffer, but the VM generates the

(long offset, long length)

Source from the content-addressed store, hash-verified

586 * @return a direct ByteBuffer that accesses the memory being pointed to,
587 */
588 @Override
589 public ByteBuffer getByteBuffer(long offset, long length) {
590 boundsCheck(offset, length);
591 ByteBuffer b = super.getByteBuffer(offset, length);
592 // Ensure this Memory object will not be GC'd (and its memory freed)
593 // if the Buffer is still extant.
594 buffers.put(b, this);
595 return b;
596 }
597
598 @Override
599 public String getString(long offset, String encoding) {

Callers 15

listXAttrMethod · 0.95
testByteBufferPutByteMethod · 0.95
testByteBufferPutIntMethod · 0.95
testByteBufferPutLongMethod · 0.95
testByteBufferGetByteMethod · 0.95
testByteBufferGetIntMethod · 0.95
testByteBufferGetLongMethod · 0.95
testIntBufferPutMethod · 0.95
testLongBufferPutMethod · 0.95
testFloatBufferPutMethod · 0.95

Calls 2

boundsCheckMethod · 0.95
putMethod · 0.80

Tested by 15

testByteBufferPutByteMethod · 0.76
testByteBufferPutIntMethod · 0.76
testByteBufferPutLongMethod · 0.76
testByteBufferGetByteMethod · 0.76
testByteBufferGetIntMethod · 0.76
testByteBufferGetLongMethod · 0.76
testIntBufferPutMethod · 0.76
testLongBufferPutMethod · 0.76
testFloatBufferPutMethod · 0.76
testDoubleBufferPutMethod · 0.76