在Java 7中如何可移植地获得文件存储的块大小? [英] How can the block size of a file store be portably obtained in Java 7?

查看:111
本文介绍了在Java 7中如何可移植地获得文件存储的块大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看了 java.nio.file.attribute.Attributes java.nio.file.FileStore ,但找不到找到磁盘文件块大小的方法。

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.

推荐答案

这是一个<缓冲区大小与I / O吞吐量有关的文章。剧情简介:nio为你处理所有这些事情。这个 SO帖子总结你应该使用2的幂。

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.

这篇关于在Java 7中如何可移植地获得文件存储的块大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆