[jboss-dev-forums] [Design of JBoss Remoting, Unified Invokers] - Re: Encryption in Remoting

clebert.suconic@jboss.com do-not-reply at jboss.com
Tue Aug 15 12:26:39 EDT 2006


If you can't find a parameter to flush data without close the stream...

What about to use a fake output stream to change the behavior on .close operations:

It's kind of a hack... but if there isn't another option.

import java.io.IOException;
  | import java.io.*;
  | 
  | public class FlushOnCloseOutputStream extends OutputStream
  | {
  | 	OutputStream delegate;
  | 
  | 	public void close() throws IOException {
  | 		delegate.flush(); // here
  | 	}
  | 
  | 	public boolean equals(Object arg0) {
  | 		return delegate.equals(arg0);
  | 	}
  | 
  | 	public void flush() throws IOException {
  | 		delegate.flush();
  | 	}
  | 
  | 	public int hashCode() {
  | 		return delegate.hashCode();
  | 	}
  | 
  | 	public void write(byte[] b, int off, int len) throws IOException {
  | 		delegate.write(b, off, len);
  | 	}
  | 
  | 	public void write(byte[] b) throws IOException {
  | 		delegate.write(b);
  | 	}
  | 
  | 	public void write(int b) throws IOException {
  | 		delegate.write(b);
  | 	}
  | 	
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965315#3965315

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965315



More information about the jboss-dev-forums mailing list