20230622 java.io.FileOutputStream

发布时间 2023-08-23 10:03:13作者: 流星<。)#)))≦

介绍

  • java.io.FileOutputStream
  • public class FileOutputStream extends OutputStream
  • 提供附着在一个磁盘文件上的输出流

API

构造器

  • FileOutputStream(String name) throws FileNotFoundException
  • FileOutputStream(String name, boolean append)
  • FileOutputStream(File file) throws FileNotFoundException
  • FileOutputStream(File file, boolean append) throws FileNotFoundException
  • FileOutputStream(FileDescriptor fdObj)
    • append : 是否追加模式,默认写入模式(false)
      • 追加模式:将内容追加到文件原内容中
      • 写入模式:覆盖文件原内容

public

  • getFD
    • final FileDescriptor getFD() throws IOException
  • getChannel
    • FileChannel getChannel()