20230621 java.io.Writer

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

介绍

  • java.io.Writer
  • public abstract class Writer implements Appendable, Closeable, Flushable

API

  • write

    • abstract void write(char cbuf[], int off, int len) throws IOException;
      • 唯一的抽象方法
    • void write(int c) throws IOException
      • 写入一个字符(两个字节,一个 char)
    • void write(char cbuf[]) throws IOException
    • void write(String str) throws IOException
    • void write(String str, int off, int len) throws IOException
  • append

    • Writer append(char c) throws IOException
    • Writer append(CharSequence csq) throws IOException
    • Writer append(CharSequence csq, int start, int end) throws IOException
  • flush

  • close

  • nullWriter