001
014
015 package com.liferay.portal.kernel.io.unsync;
016
017 import java.io.IOException;
018 import java.io.OutputStream;
019
020
027 public class UnsyncFilterOutputStream extends OutputStream {
028
029 public UnsyncFilterOutputStream(OutputStream outputStream) {
030 this.outputStream = outputStream;
031 }
032
033 @Override
034 public void close() throws IOException {
035 try {
036 flush();
037 }
038 catch (IOException ioe) {
039 }
040
041 outputStream.close();
042 }
043
044 @Override
045 public void flush() throws IOException {
046 outputStream.flush();
047 }
048
049 @Override
050 public void write(byte[] bytes) throws IOException {
051 outputStream.write(bytes, 0, bytes.length);
052 }
053
054 @Override
055 public void write(byte[] bytes, int offset, int length) throws IOException {
056 outputStream.write(bytes, offset, length);
057 }
058
059 @Override
060 public void write(int b) throws IOException {
061 outputStream.write(b);
062 }
063
064 protected OutputStream outputStream;
065
066 }