org.eclipse.jetty.server

## Class HttpWriter

- java.lang.Object
- - java.io.Writer
  - - org.eclipse.jetty.server.HttpWriter

- All Implemented Interfaces:
    Closeable, Flushable, Appendable, AutoCloseable
  Direct Known Subclasses:
    AbstractHttpConnection.OutputWriter

      public class HttpWriter
      extends Writer

  OutputWriter. A writer that can wrap a `HttpOutput` stream and provide character encodings. The UTF-8 encoding is done by this class and no additional buffers or Writers are used. The UTF-8 code was inspired by http://javolution.org

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `MAX_OUTPUT_CHARS`

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

      `lock`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpWriter(HttpOutput out)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `flush()`
    `void` | `setCharacterEncoding(String encoding)`
    `void` | `write(char[] s, int offset, int length)`
    `void` | `write(String s, int offset, int length)`

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

      `append, append, append, write, write, write`

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

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

- - ### Field Detail

    - #### MAX_OUTPUT_CHARS

          public static final int MAX_OUTPUT_CHARS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HttpWriter

          public HttpWriter(HttpOutput out)

  - ### Method Detail

    - #### setCharacterEncoding

          public void setCharacterEncoding(String encoding)

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in class `Writer`
      Throws:
        `IOException`

    - #### flush

          public void flush()
                     throws IOException

      Specified by:
        `flush` in interface `Flushable`
      Specified by:
        `flush` in class `Writer`
      Throws:
        `IOException`

    - #### write

          public void write(String s,
                   int offset,
                   int length)
                     throws IOException

      Overrides:
        `write` in class `Writer`
      Throws:
        `IOException`

    - #### write

          public void write(char[] s,
                   int offset,
                   int length)
                     throws IOException

      Specified by:
        `write` in class `Writer`
      Throws:
        `IOException`

Copyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.