Package org.codehaus.groovy.runtime

# Class FlushingStreamWriter

java.lang.Object
java.io.Writer
java.io.OutputStreamWriter
org.codehaus.groovy.runtime.FlushingStreamWriter

All Implemented Interfaces:
  `Closeable`, `Flushable`, `Appendable`, `AutoCloseable`

public class FlushingStreamWriter extends OutputStreamWriter
Stream writer which flushes after each write operation.

- ## Field Summary

  ### Fields inherited from class java.io.Writer

  `lock`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FlushingStreamWriter(OutputStream out)`
  Constructs a FlushingStreamWriter that flushes on every write.
  `FlushingStreamWriter(OutputStream out, Charset charset)`
  Constructs a FlushingStreamWriter that flushes on every write.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `write(char[] cbuf, int off, int len)`
  `void`
  `write(int c)`
  `void`
  `write(String str, int off, int len)`

  ### Methods inherited from class java.io.OutputStreamWriter

  `append, append, close, flush, getEncoding`

  ### Methods inherited from class java.io.Writer

  `append, nullWriter, write, write`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FlushingStreamWriter

    public FlushingStreamWriter(OutputStream out)
    Constructs a FlushingStreamWriter that flushes on every write.
    Parameters:
      `out` - the underlying output stream to write to
    Throws:
      `NullPointerException` - if out is null

  - ### FlushingStreamWriter

    public FlushingStreamWriter(OutputStream out, Charset charset)
    Constructs a FlushingStreamWriter that flushes on every write.
    Parameters:
      `out` - the underlying output stream to write to
      `charset` - the charset to encode with
    Throws:
      `NullPointerException` - if out or charset is null
    Since:
      6.0.0

- ## Method Details

  - ### write

    public void write(char[] cbuf, int off, int len) throws IOException
    Overrides:
      `write` in class `OutputStreamWriter`
    Throws:
      `IOException`

  - ### write

    public void write(int c) throws IOException
    Overrides:
      `write` in class `OutputStreamWriter`
    Throws:
      `IOException`

  - ### write

    public void write(String str, int off, int len) throws IOException
    Overrides:
      `write` in class `OutputStreamWriter`
    Throws:
      `IOException`