|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream javax.servlet.ServletOutputStream org.blojsom.filter.GZIPResponseStream
GZIPResponseStream
Copyright 2003 Jayson Falkner (jayson@jspinsider.com) This code is from "Servlets and JavaServer pages; the J2EE Web Tier", http://www.jspbook.com. You may freely use the code both commercially and non-commercially. If you like the code, please pick up a copy of the book and help support the authors, development of more free code, and the JSP/Servlet/J2EE community.
Field Summary | |
protected java.io.ByteArrayOutputStream |
baos
|
protected boolean |
closed
|
protected java.util.zip.GZIPOutputStream |
gzipstream
|
protected javax.servlet.ServletOutputStream |
output
|
protected javax.servlet.http.HttpServletResponse |
response
|
Constructor Summary | |
GZIPResponseStream(javax.servlet.http.HttpServletResponse response)
Create a new GZIPResponseStream |
Method Summary | |
void |
close()
Close this response stream |
boolean |
closed()
Returns true if the stream is closed, false otherwise |
void |
flush()
Flush the response stream |
void |
reset()
Reset the stream. |
void |
write(byte[] b)
Write a byte array to the stream |
void |
write(byte[] b,
int off,
int len)
Write a byte array to the stream |
void |
write(int b)
Write a byte to the stream |
Methods inherited from class javax.servlet.ServletOutputStream |
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.io.ByteArrayOutputStream baos
protected java.util.zip.GZIPOutputStream gzipstream
protected boolean closed
protected javax.servlet.http.HttpServletResponse response
protected javax.servlet.ServletOutputStream output
Constructor Detail |
public GZIPResponseStream(javax.servlet.http.HttpServletResponse response) throws java.io.IOException
response
- Original HTTP servlet response
java.io.IOException
- If there is an error creating the response streamMethod Detail |
public void close() throws java.io.IOException
java.io.IOException
- If the stream is already closed or there is an error closing the streampublic void flush() throws java.io.IOException
java.io.IOException
- If the stream is already closed or there is an error flushing the streampublic void write(int b) throws java.io.IOException
b
- Byte to write
java.io.IOException
- If the stream is closed or there is an error in writingpublic void write(byte[] b) throws java.io.IOException
b
- Byte array to write
java.io.IOException
- If the stream is closed or there is an error in writingpublic void write(byte[] b, int off, int len) throws java.io.IOException
b
- Byte array to writeoff
- Offset of starting point in byte array to start writinglen
- Length of bytes to write
java.io.IOException
- If the stream is closed or there is an error in writingpublic boolean closed()
true
if the stream is closed, false
otherwise
true
if the stream is closed, false
otherwisepublic void reset()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |