Mercurial Hosting > luan
view src/goodjava/webserver/ResponseOutputStream.java @ 2082:cdc9a31c6f71 ssltesting
update renewSsl.sh to reflect changes in directory structure
| author | Violet7 |
|---|---|
| date | Tue, 09 Dec 2025 17:53:16 -0800 |
| parents | bba3e529e346 |
| children |
line wrap: on
line source
package goodjava.webserver; import java.io.ByteArrayOutputStream; import java.io.ByteArrayInputStream; import java.io.IOException; public class ResponseOutputStream extends ByteArrayOutputStream { private final Response response; public ResponseOutputStream(Response response) { if(response==null) throw new NullPointerException(); this.response = response; } @Override public void close() throws IOException { super.close(); int size = size(); response.headers.put("Content-Length",Long.toString(size)); response.body = new ByteArrayInputStream(buf,0,size); } }
