static public ByteBuffer newDirectBuffer ( long address , int size ) { if ( directByteBufferConstructor == null ) throw new UnsupportedOperationException ( "No direct ByteBuffer constructor is available." ) ; try { return directByteBufferConstructor . newInstance ( address , size , null ) ; } catch ( Exception ex ) { throw new KryoException ( "Error creating a ByteBuffer at address: " + address , ex ) ; } }
Create a ByteBuffer that uses the specified off - heap memory address instead of allocating a new one .