package com.test;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
public class MakeFile {
public static long KBSIZE = 1024;
public static long MBSIZE1 = 1024 * 1024;
public static long MBSIZE10 = 1024 * 1024 * 10;
public static void main(String[] args) {
//生成的文件路径
String path = "C:\\Documents and Settings\\Administrator\\桌面\\test.txt";
File file = new File(path);
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
//生成512字节大小文件
// createFile(file,512);
//生成1Kb大小文件
// createFile(file,1024);
//生成5Kb大小文件
// createFile(file,1024*5);
//生成10Kb大小文件
// createFile(file,1024*10);