[hornetq-commits] JBoss hornetq SVN: r10005 - trunk/src/main/org/hornetq/utils.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Dec 6 23:33:00 EST 2010


Author: clebert.suconic at jboss.com
Date: 2010-12-06 23:33:00 -0500 (Mon, 06 Dec 2010)
New Revision: 10005

Modified:
   trunk/src/main/org/hornetq/utils/InflaterWriter.java
Log:
just cleanup imports

Modified: trunk/src/main/org/hornetq/utils/InflaterWriter.java
===================================================================
--- trunk/src/main/org/hornetq/utils/InflaterWriter.java	2010-12-07 04:22:51 UTC (rev 10004)
+++ trunk/src/main/org/hornetq/utils/InflaterWriter.java	2010-12-07 04:33:00 UTC (rev 10005)
@@ -13,12 +13,9 @@
 
 package org.hornetq.utils;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.zip.DataFormatException;
-import java.util.zip.Deflater;
 import java.util.zip.Inflater;
 
 /**
@@ -35,15 +32,17 @@
  */
 public class InflaterWriter extends OutputStream
 {
-   private Inflater inflater = new Inflater();
-   private OutputStream output;
-   
-   private byte[] writeBuffer = new byte[1024];
+   private final Inflater inflater = new Inflater();
+
+   private final OutputStream output;
+
+   private final byte[] writeBuffer = new byte[1024];
+
    private int writePointer = 0;
-   
-   private byte[] outputBuffer = new byte[writeBuffer.length*2];
-   
-   public InflaterWriter(OutputStream output)
+
+   private final byte[] outputBuffer = new byte[writeBuffer.length * 2];
+
+   public InflaterWriter(final OutputStream output)
    {
       this.output = output;
    }
@@ -52,11 +51,11 @@
     * Write a compressed byte.
     */
    @Override
-   public void write(int b) throws IOException
+   public void write(final int b) throws IOException
    {
       writeBuffer[writePointer] = (byte)(b & 0xFF);
       writePointer++;
-      
+
       if (writePointer == writeBuffer.length)
       {
          writePointer = 0;
@@ -70,7 +69,7 @@
          }
       }
    }
-   
+
    @Override
    public void close() throws IOException
    {
@@ -93,12 +92,12 @@
          }
       }
    }
-   
+
    private void doWrite() throws DataFormatException, IOException
    {
       inflater.setInput(writeBuffer);
       int n = inflater.inflate(outputBuffer);
-      
+
       while (n > 0)
       {
          output.write(outputBuffer, 0, n);



More information about the hornetq-commits mailing list