harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjanu...@apache.org
Subject svn commit: r703107 - in /harmony/enhanced/classlib/trunk/modules/pack200/src: main/java/org/apache/harmony/unpack200/BandSet.java test/java/org/apache/harmony/unpack200/tests/ClassBandsTest.java
Date Thu, 09 Oct 2008 08:53:42 GMT
Author: sjanuary
Date: Thu Oct  9 01:53:41 2008
New Revision: 703107

URL: http://svn.apache.org/viewvc?rev=703107&view=rev
Log:
Unpack200 - reorganise some methods

Modified:
    harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/BandSet.java
    harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ClassBandsTest.java

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/BandSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/BandSet.java?rev=703107&r1=703106&r2=703107&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/BandSet.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/main/java/org/apache/harmony/unpack200/BandSet.java
Thu Oct  9 01:53:41 2008
@@ -268,15 +268,6 @@
         return band;
     }
 
-    public byte[] encodeBandLong(long[] data, BHSDCodec codec)
-            throws IOException, Pack200Exception {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        for (int i = 0; i < data.length; i++) {
-            baos.write(codec.encode(data[i], i == 0 ? 0 : data[i - 1]));
-        }
-        return baos.toByteArray();
-    }
-
     public long[] parseFlags(String name, InputStream in, int count,
             BHSDCodec codec, boolean hasHi) throws IOException,
             Pack200Exception {

Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ClassBandsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ClassBandsTest.java?rev=703107&r1=703106&r2=703107&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ClassBandsTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/ClassBandsTest.java
Thu Oct  9 01:53:41 2008
@@ -17,8 +17,10 @@
 package org.apache.harmony.unpack200.tests;
 
 import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
+import org.apache.harmony.pack200.BHSDCodec;
 import org.apache.harmony.pack200.Codec;
 import org.apache.harmony.pack200.Pack200Exception;
 import org.apache.harmony.unpack200.ClassBands;
@@ -90,7 +92,7 @@
         byte[] classThis = Codec.DELTA5.encode(1, 0);
         byte[] classSuper = Codec.DELTA5.encode(2, 0);
         byte[] classInterfaceCount = Codec.DELTA5.encode(2, 0);
-        byte[] classInterfaceRef1 = classBands.encodeBandLong(
+        byte[] classInterfaceRef1 = encodeBandLong(
                 new long[] { 3, 4 }, Codec.DELTA5);
         byte[] classFieldCount = Codec.DELTA5.encode(0, 0);
         byte[] classMethodCount = Codec.DELTA5.encode(0, 0);
@@ -130,9 +132,9 @@
         byte[] classInterfaceCount = Codec.DELTA5.encode(0, 0);
         byte[] classFieldCount = Codec.DELTA5.encode(0, 0);
         byte[] classMethodCount = Codec.DELTA5.encode(3, 0);
-        byte[] methodDescr = classBands.encodeBandLong(new long[] { 0, 1, 2 },
+        byte[] methodDescr = encodeBandLong(new long[] { 0, 1, 2 },
                 Codec.MDELTA5);
-        byte[] methodFlagsLo = classBands.encodeBandLong(
+        byte[] methodFlagsLo = encodeBandLong(
                 new long[] { 0, 0, 0 }, Codec.UNSIGNED5);
         byte[] classFlags = Codec.UNSIGNED5.encode(0, 0);
         byte[][] allArrays = new byte[][] { classThis, classSuper,
@@ -164,4 +166,14 @@
         cpDescriptor = null;
     }
 
+    public byte[] encodeBandLong(long[] data, BHSDCodec codec)
+            throws IOException, Pack200Exception {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        for (int i = 0; i < data.length; i++) {
+            baos.write(codec.encode(data[i], i == 0 ? 0 : data[i - 1]));
+        }
+        return baos.toByteArray();
+    }
+
+
 }



Mime
View raw message