org.apache.commons.io.build

## Class AbstractOrigin.WriterOrigin

- java.lang.Object
- - org.apache.commons.io.build.AbstractSupplier<T,B>
  - - org.apache.commons.io.build.AbstractOrigin<Writer,AbstractOrigin.WriterOrigin>
    - - org.apache.commons.io.build.AbstractOrigin.WriterOrigin

- All Implemented Interfaces:
    IOSupplier<Writer>
  Enclosing class:
    AbstractOrigin<T,B extends AbstractOrigin<T,B>>

      public static class AbstractOrigin.WriterOrigin
      extends AbstractOrigin<Writer,AbstractOrigin.WriterOrigin>

  An `Writer` origin.

  This origin cannot provide other aspects.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.commons.io.build.AbstractOrigin

      `AbstractOrigin.ByteArrayOrigin, AbstractOrigin.FileOrigin, AbstractOrigin.InputStreamOrigin, AbstractOrigin.OutputStreamOrigin, AbstractOrigin.PathOrigin, AbstractOrigin.ReaderOrigin, AbstractOrigin.URIOrigin, AbstractOrigin.WriterOrigin`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WriterOrigin(Writer origin)` Constructs a new instance for the given origin.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Writer` | `getWriter(Charset charset, OpenOption... options)` Gets a new Writer on the origin, buffered by default.

    - ### Methods inherited from class org.apache.commons.io.build.AbstractOrigin

      `get, getByteArray, getFile, getInputStream, getOutputStream, getPath, getReader, toString`

    - ### Methods inherited from class org.apache.commons.io.build.AbstractSupplier

      `asThis`

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

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

    - ### Methods inherited from interface org.apache.commons.io.function.IOSupplier

      `asSupplier`

- - ### Constructor Detail

    - #### WriterOrigin

          public WriterOrigin(Writer origin)

      Constructs a new instance for the given origin.
      Parameters:
        `origin` - The origin.

  - ### Method Detail

    - #### getWriter

          public Writer getWriter(Charset charset,
                                  OpenOption... options)
                           throws IOException

      Description copied from class: `AbstractOrigin`
      Gets a new Writer on the origin, buffered by default.
      Overrides:
        `getWriter` in class `AbstractOrigin<Writer,AbstractOrigin.WriterOrigin>`
      Parameters:
        `charset` - the charset to use for encoding
        `options` - options specifying how the file is opened
      Returns:
        a new Writer on the origin.
      Throws:
        `IOException` - if an I/O error occurs opening or creating the file.

Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.