在电脑是新建一个文件夹
File file = new File("F:\\imgs");
File file = new File("F:/imgs");
输入:
字节流:
inputStream
FileInputStream
DataInputStream(读取二进制文件,如图片,音频)
字符流:
Reader
InputStresmReader
FileReader
BufferedReader (带有缓冲区的字符流,可以整行读取,构建时需要把Reader放进来)
输出:
字节流:
OutputStream
FileOutPutStream
DataOutputStream(读取二进制文件,如图片,音频)
字符流:
Writer
OutputStreamWriter
FileWriter
BufferedReader (带有缓冲区的字符流,构建时需要把Writer放进来)
序列化:(传输对象) 必须实现serializable
ObjectInputStream ObjectOutputStream
readObject() writeObject()