package coreservlets.filters;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

/** StringOutputStream dziedziczy po ServletOutputStream, która
 *  buforuje dane wynikowe w ciągu znaków zamiast wysyłać je
 *  bezpośrednio do klienta.
 *  <P>
 *  Taken from Core Servlets and JavaServer Pages Volume II
 *  from Prentice Hall and Sun Microsystems Press,
 *  http://volume2.coreservlets.com/.
 *  (C) 2007 Marty Hall, Larry Brown, and Yaakov Chaikin;
 *  may be freely used or adapted.
 */
public class StringOutputStream
             extends ServletOutputStream {
  private StringWriter stringWriter;

  public StringOutputStream(StringWriter stringWriter) {
    this.stringWriter = stringWriter;
  }

  public void write(int c) {
    stringWriter.write(c);
  }
}
