true保存上次数据
fos.write("xxxxxx".getBytes());/// byte[] bytes = {123,22,33,55}; fos.write(bytes);
public class Note02 {
public static void main(String[] args) {
try {
FileOutputStream fos = new FileOutputStream("D:\\a.txt",true);
fos.write("xxxxx".getBytes());
fos.close();
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
}
ctrl+p提示
mkdir创造多层文件加smkdirs
构造方法只能放文件的路径,字符串形式。
createNewFile(创建名称的空文件,不创建文件夹
exists(判断文件或目录是否存在
isDirectory判断是否是目录/文件夹
isFile)判断是否是文件
length()返回文件的长度,单位为字节
复制路径一样换\\