001 package railo.commons.io.res.type.compress; 002 003 import java.io.IOException; 004 import java.io.OutputStream; 005 006 public final class CompressOutputStreamSynchronizer extends OutputStream { 007 008 private final OutputStream os; 009 private final Compress zip; 010 private final boolean async; 011 012 public CompressOutputStreamSynchronizer(OutputStream os, Compress zip,boolean async) { 013 this.os=os; 014 this.zip=zip; 015 this.async=async; 016 } 017 018 @Override 019 public void close() throws IOException { 020 os.close(); 021 zip.synchronize(async); 022 } 023 024 @Override 025 public void flush() throws IOException { 026 os.flush(); 027 } 028 029 @Override 030 public void write(int b) throws IOException { 031 os.write(b); 032 } 033 034 @Override 035 public void write(byte[] b, int off, int len) throws IOException { 036 os.write(b, off, len); 037 } 038 039 @Override 040 public void write(byte[] b) throws IOException { 041 os.write(b); 042 } 043 044 }