3 ms·
You are correct. DirectByteBuffer only guarantees that the memory will not be moved as a result of garbage collection, for example, when talking with native co
by java-man 5y ago
You are correct.
DirectByteBuffer only guarantees that the memory will not be moved as a result of garbage collection, for example, when talking with native code.
It does not prevent the OS from paging the whole memory block to disk, or writing it to a file in case of a VM saving its state.
It's just marginally better than using plain primitive arrays, plus there is an extra method to explicitly clear the buffers via ICryptoZeroable, something that I think is missing from stock Bouncycastle.