问题
I've looked at java.nio.file.attribute.Attributes
and java.nio.file.FileStore
, but couldn't find a way to discover the block-size of a disk-file.
回答1:
Here is an article on buffer size vs I/O throughput. Synopsis: nio handles all of that for you. This SO post concludes you should use a power of 2.
来源:https://stackoverflow.com/questions/3892186/how-can-the-block-size-of-a-file-store-be-portably-obtained-in-java-7