Package org.jboss.resteasy.spi

## Class AsyncOutputWriter

- java.lang.Object
- - org.jboss.resteasy.spi.AsyncOutputWriter

-     public class AsyncOutputWriter
      extends Object

  Utility class to write to an `AsyncOutputStream` using a given `Charset`.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AsyncOutputWriter​(AsyncOutputStream asyncOutputStream)` | Creates a new async writer using the default charset.
    `AsyncOutputWriter​(AsyncOutputStream asyncOutputStream, Charset charset)` | Creates a new async writer using the specified charset.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CompletionStage<Void>` | `asyncFlush()` | Flushes the underlying async output stream.
    `CompletionStage<Void>` | `asyncWrite​(String s)` | Writes the given string to the underlying async output stream.

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

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

- - ### Constructor Detail

    - #### AsyncOutputWriter

          public AsyncOutputWriter​(AsyncOutputStream asyncOutputStream)

      Creates a new async writer using the default charset.
      Parameters:
        `asyncOutputStream` - the async output stream on which to write

    - #### AsyncOutputWriter

          public AsyncOutputWriter​(AsyncOutputStream asyncOutputStream,
                                   Charset charset)

      Creates a new async writer using the specified charset.
      Parameters:
        `asyncOutputStream` - the async output stream on which to write
        `charset` - the charset to use

  - ### Method Detail

    - #### asyncWrite

          public CompletionStage<Void> asyncWrite​(String s)

      Writes the given string to the underlying async output stream.
      Parameters:
        `string` - the string to write, using the specified charset
      Returns:
        a `CompletionStage` indicating completion.

    - #### asyncFlush

          public CompletionStage<Void> asyncFlush()

      Flushes the underlying async output stream.
      Returns:
        a `CompletionStage` indicating completion.