All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.n2oapp.framework.mvc.api.BufferedHttpResponse Maven / Gradle / Ivy

There is a newer version: 7.28.2
Show newest version
package net.n2oapp.framework.mvc.api;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import java.io.CharArrayWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;

/**
 * @author iryabov
 * @since 15.12.2015
 */
public class BufferedHttpResponse extends HttpServletResponseWrapper {

    private final Writer buffer;

    public BufferedHttpResponse(HttpServletResponse response, Writer buffer) {
        super(response);
        this.buffer = buffer;
    }

    @Override
    public PrintWriter getWriter() throws IOException {
        return new PrintWriter(buffer);
    }

    public Writer getBuffer() {
        return buffer;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy