|
||||||||||
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 | +--de.oio.bugkilla.splitter.SplitterServletOutputStreamImpl
A class to write the incomning response data synchronously in a ByteArrayOutputStream
.
The SplitterServletOutputSreamImpl wrappes the original response stream from the given HttpServletResponse
object. If the container invokes the method getOutputStream
oder getWriter
of the
response and an instance of this class is used to write in the written data will be saved independently in
a seperate stream.
Constructor Summary | |
SplitterServletOutputStreamImpl(javax.servlet.http.HttpServletResponse response)
Constructs a new SplitterServletOutputStreamImpl that splits the response data into a seperate buffer. |
Method Summary | |
void |
close()
Closes the original response output stream. |
byte[] |
getContent()
Returns the content that is written into the original response stream as a byte array. |
java.lang.String |
getContentAsString()
Returns the content that is written into the original response stream as a String. |
void |
write(byte[] b)
Writes b.length bytes from the specified byte array to the original
reponse output stream and synchronously into a local stream. |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array starting at offset off
to the original reponse output stream and synchronously into a local stream. |
void |
write(int b)
Writes the specified byte to the original reponse output stream and synchronously into a local 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.io.OutputStream |
flush |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SplitterServletOutputStreamImpl(javax.servlet.http.HttpServletResponse response)
response
- - the response its data should also be written in the seperated streamMethod Detail |
public byte[] getContent()
public java.lang.String getContentAsString()
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- - the byte.
java.io.IOException
- - if an I/O error occurs.public void write(byte[] b) throws java.io.IOException
b.length
bytes from the specified byte array to the original
reponse output stream and synchronously into a local stream.
write
in class java.io.OutputStream
b
- - the data.
java.io.IOException
- - if an I/O error occurs.write(byte[] b, int off, int len)
public void write(byte[] b, int off, int len) throws java.io.IOException
len
bytes from the specified byte array starting at offset off
to the original reponse output stream and synchronously into a local stream.
write
in class java.io.OutputStream
b
- - the data.off
- - the start offset in the data.len
- - the number of bytes to write.
java.io.IOException
- - if an I/O error occurs. In particular, an IOException is
thrown if the output stream is closed.public void close() throws java.io.IOException
close
of the superclass the
saved content is given to the guard class of the response.
close
in class java.io.OutputStream
java.io.IOException
- - if an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |