public class File extends File
pathSeparator, pathSeparatorChar, separator, separatorChar| 构造器和说明 |
|---|
File(File parent,
String child) |
File(String path) |
File(String parent,
String child) |
File(URI uri) |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
read()
读取文件内容
|
void |
write(byte[] bytes)
向文件写内容
|
void |
write(char[] chars)
向文件写内容
|
void |
write(String str)
向文件写内容
|
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURLpublic String read() throws FileNotFoundException, IOException
FileNotFoundException - 当文件不存在IOException - IO 异常public void write(String str) throws IOException
str - 待写入内容IOException - IO 异常public void write(char[] chars)
throws IOException
chars - 待写入内容IOException - IO 异常public void write(byte[] bytes)
throws IOException
bytes - 待写入内容IOException - IO 异常Copyright © 2020 buession.com Inc.. All rights reserved.