001
014
015 package com.liferay.portal.servlet.filters.gzip;
016
017 import java.io.IOException;
018 import java.io.OutputStream;
019
020 import java.util.zip.GZIPOutputStream;
021
022 import javax.servlet.ServletOutputStream;
023
024
027 public class GZipServletOutputStream extends ServletOutputStream {
028
029 public GZipServletOutputStream(OutputStream outputStream)
030 throws IOException {
031
032 _gZipOutputStream = new GZIPOutputStream(outputStream);
033 }
034
035 public void close() throws IOException {
036 _gZipOutputStream.close();
037 }
038
039 public void flush() throws IOException {
040 _gZipOutputStream.flush();
041 }
042
043 public void write(byte[] byteArray) throws IOException {
044 _gZipOutputStream.write(byteArray);
045 }
046
047 public void write(byte[] byteArray, int offset, int length)
048 throws IOException {
049
050 _gZipOutputStream.write(byteArray, offset, length);
051 }
052
053 public void write(int b) throws IOException {
054 _gZipOutputStream.write(b);
055 }
056
057 private GZIPOutputStream _gZipOutputStream;
058
059 }