Class ServletOutputStreamWrapper

java.lang.Object
java.io.OutputStream
jakarta.servlet.ServletOutputStream
org.zkoss.web.servlet.ServletOutputStreamWrapper
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class ServletOutputStreamWrapper extends jakarta.servlet.ServletOutputStream
A facade of OutputStream for implementing ServletOutputStream.
Author:
tomyeh
  • Constructor Details

    • ServletOutputStreamWrapper

      public ServletOutputStreamWrapper(Writer writer, String charset)
      Parameters:
      charset - the charset. If null, "UTF-8" is assumed.
  • Method Details

    • getInstance

      public static jakarta.servlet.ServletOutputStream getInstance(OutputStream stream)
      Returns a facade of the specified stream.
    • getInstance

      public static jakarta.servlet.ServletOutputStream getInstance(Writer writer, String charset)
      Returns a facade of the specified writer.
      Parameters:
      charset - the charset. If null, "UTF-8" is assumed.
    • write

      public void write(int b) throws IOException
      Specified by:
      write in class OutputStream
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      Specified by:
      flush in interface Flushable
      Overrides:
      flush in class OutputStream
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream
      Throws:
      IOException
    • isReady

      public boolean isReady()
      Specified by:
      isReady in class jakarta.servlet.ServletOutputStream
    • setWriteListener

      public void setWriteListener(jakarta.servlet.WriteListener writeListener)
      Specified by:
      setWriteListener in class jakarta.servlet.ServletOutputStream