http://www.rgagnon.com/javadetails/java-0014.html
Windows rundll32 utility
Windows File association Any program using the Windows file association mechanism can be started with the rundll32 utility. // "file" is the filename of the data file // ex. myresume.doc // to start Word if the doc extension is associated with it. Runtime.getRuntime().exec ("rundll32 SHELL32.DLL,ShellExec_RunDLL " + file.getAbsolutePath());
PDF (Windows only)
public class ShowPDF { public static void main(String[] args) throws Exception { Process p = Runtime.getRuntime() .exec("rundll32 url.dll,FileProtocolHandler c:/pdf/mypdf.pdf"); p.waitFor(); System.out.println("Done."); } }SyncPipe
java.nio.channels.FileChannel
任何时间只有一个线程在执行操作。
可以锁定局部文件区域。
对巨大文件,载入一部分。便利操作。
方便,操作系统优化载体直接写,加速读写速度。
复写、扩增、缩减,文件尺寸。