Proposal for adding O_DIRECT support into JDK 9

Alan Bateman Alan.Bateman at oracle.com
Tue Sep 5 06:38:09 UTC 2017



On 05/09/2017 04:44, huaming.li at oracle.com wrote:
> Maybe there is misunderstanding here, I don't mean we should add such 
> method in test, I means to add a new API in java.nio.ByteBuffer class, 
> the reason is that "ByteBuffer.allocateDirect(SIZE + alignment - 
> 1).alignedSlice(alignment);" is necessary for a direct read/write, a 
> new API for example ByteBuffer.allocateAlignedDirect(size, alignment) 
> or allocateAlignedDirect(size) might be helpful for direct io end user.
This topic was discussed previously and I think we decided not rev the 
ByteBuffer API in this iteration. One reason is that direct I/O is a 
super advanced topic and not something that regular developers will use. 
So I think the right thing is to move forward on the API as is and 
re-examine the ByteBuffer API at a future time in the event that 
advanced developers still need additions to help them use the API.

-Alan


More information about the nio-dev mailing list