r/programming • u/Happycodeine • Jan 04 '19
Using Java to Read Really, Really Large Files
https://medium.com/@paigen11/a6f8a3f44649
7
Upvotes
r/programming • u/Happycodeine • Jan 04 '19
View all comments
Show parent comment
1
u/[deleted] Jan 06 '19
But how will you expose unmanaged memory buffers to a managed environment? I mean, you'd have to let the system to write into the memory allocated by JVM. I cannot think of a way to safely deallocate this memory using the tools available in Java. But, this problem aside, how'd you expose the contents of such buffers to JVM? What would a read from such buffer return? If it's a bytearray, an integer etc: you've wasted memory, but you cannot return a pointer...