use of javax.servlet.WriteListener in project grails-core by grails.
the class IncludeResponseWrapper method getOutputStream.
@Override
public ServletOutputStream getOutputStream() throws IOException {
if (usingWriter)
throw new IllegalStateException("Method getWriter() already called");
if (!usingStream) {
usingStream = true;
byteBuffer = new StreamByteBuffer();
os = byteBuffer.getOutputStream();
sos = new ServletOutputStream() {
@Override
public void write(byte[] b, int off, int len) throws IOException {
os.write(b, off, len);
}
@Override
public void write(byte[] b) throws IOException {
os.write(b);
}
@Override
public void write(int b) throws IOException {
os.write(b);
}
@Override
public boolean isReady() {
return true;
}
@Override
public void setWriteListener(WriteListener writeListener) {
// no op
}
};
}
return sos;
}
Aggregations