[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/marshal/compress ...

Ron Sigal ron_sigal at yahoo.com
Tue Nov 20 21:33:02 EST 2007


  User: rsigal  
  Date: 07/11/20 21:33:02

  Modified:    src/main/org/jboss/remoting/marshal/compress  Tag:
                        remoting_2_x CompressingMarshaller.java
  Log:
  JBREM-677: (1) Added getMarshallingStream(); (2) uses BufferedOutputStream; (3) reordered GZIPOutputStream.finish() and ObjectOutputStream.flush().
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.4.2   +11 -3     JBossRemoting/src/main/org/jboss/remoting/marshal/compress/CompressingMarshaller.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CompressingMarshaller.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/marshal/compress/CompressingMarshaller.java,v
  retrieving revision 1.6.4.1
  retrieving revision 1.6.4.2
  diff -u -b -r1.6.4.1 -r1.6.4.2
  --- CompressingMarshaller.java	19 May 2007 02:21:45 -0000	1.6.4.1
  +++ CompressingMarshaller.java	21 Nov 2007 02:33:02 -0000	1.6.4.2
  @@ -27,6 +27,7 @@
   import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
   import org.jboss.remoting.serialization.SerializationStreamFactory;
   
  +import java.io.BufferedOutputStream;
   import java.io.IOException;
   import java.io.ObjectOutputStream;
   import java.io.OutputStream;
  @@ -47,7 +48,7 @@
    * will create a marshaller that compresses the output of an <code>HTTPMarshaller</code>.
    *
    * @author <a href="mailto:r.sigal at computer.org">Ron Sigal</a>
  - * @version $Revision: 1.6.4.1 $
  + * @version $Revision: 1.6.4.2 $
    *          <p/>
    *          Copyright (c) 2005
    *          </p>
  @@ -78,6 +79,11 @@
         wrappedMarshaller = marshaller;
      }
   
  +   public OutputStream getMarshallingStream(OutputStream outputStream) throws IOException
  +   {
  +      return outputStream;
  +   }
  +   
   
      /**
       * Writes compressed, marshalled form of <code>dataObject</code> to <code>output</code>.
  @@ -91,7 +97,8 @@
         output.flush();
         ;
         GZIPOutputStream gzos = new GZIPOutputStream(output);
  -      ObjectOutputStream oos = SerializationStreamFactory.getManagerInstance(getSerializationType()).createOutput(gzos);
  +      BufferedOutputStream bos = new BufferedOutputStream(gzos);
  +      ObjectOutputStream oos = SerializationStreamFactory.getManagerInstance(getSerializationType()).createOutput(bos);
   
         if(wrappedMarshaller != null)
         {
  @@ -105,8 +112,9 @@
            super.write(dataObject, oos, version);
         }
   
  -      gzos.finish();
         oos.flush();
  +      gzos.finish();
  +
      }
   
      /**
  
  
  



More information about the jboss-cvs-commits mailing list