Package org.zkoss.web.servlet
Class ServletOutputStreamWrapper
- java.lang.Object
-
- java.io.OutputStream
-
- javax.servlet.ServletOutputStream
-
- org.zkoss.web.servlet.ServletOutputStreamWrapper
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class ServletOutputStreamWrapper extends javax.servlet.ServletOutputStream
A facade of OutputStream for implementing ServletOutputStream.- Author:
- tomyeh
-
-
Constructor Summary
Constructors Constructor Description ServletOutputStreamWrapper(java.io.Writer writer, java.lang.String charset)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
static javax.servlet.ServletOutputStream
getInstance(java.io.OutputStream stream)
Returns a facade of the specified stream.static javax.servlet.ServletOutputStream
getInstance(java.io.Writer writer, java.lang.String charset)
Returns a facade of the specified writer.boolean
isReady()
void
setWriteListener(javax.servlet.WriteListener writeListener)
void
write(int b)
-
-
-
Method Detail
-
getInstance
public static javax.servlet.ServletOutputStream getInstance(java.io.OutputStream stream)
Returns a facade of the specified stream.
-
getInstance
public static javax.servlet.ServletOutputStream getInstance(java.io.Writer writer, java.lang.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 java.io.IOException
- Specified by:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
isReady
public boolean isReady()
- Specified by:
isReady
in classjavax.servlet.ServletOutputStream
-
setWriteListener
public void setWriteListener(javax.servlet.WriteListener writeListener)
- Specified by:
setWriteListener
in classjavax.servlet.ServletOutputStream
-
-