directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wesmck...@apache.org
Subject svn commit: rev 6882 - incubator/directory/snickers/trunk/ber/src/java/org/apache/snickers/ber
Date Thu, 26 Feb 2004 19:37:48 GMT
Author: wesmckean
Date: Thu Feb 26 11:37:47 2004
New Revision: 6882

Removed:
   incubator/directory/snickers/trunk/ber/src/java/org/apache/snickers/ber/TLVHandler.java
Modified:
   incubator/directory/snickers/trunk/ber/src/java/org/apache/snickers/ber/BERDecoder.java
Log:


Modified: incubator/directory/snickers/trunk/ber/src/java/org/apache/snickers/ber/BERDecoder.java
==============================================================================
--- incubator/directory/snickers/trunk/ber/src/java/org/apache/snickers/ber/BERDecoder.java
(original)
+++ incubator/directory/snickers/trunk/ber/src/java/org/apache/snickers/ber/BERDecoder.java
Thu Feb 26 11:37:47 2004
@@ -140,8 +140,6 @@
         // this.
         
         if( length > 1 ) {
-            length--;
-            
             // Isolate t first byte
             aByte = value[index++] & 0xFF;
             int firstValue = 0;
@@ -162,22 +160,31 @@
         // Now process the rest of the OID ints.  Each individual
         // integer is part of the value, and we keep processing it
         // while the more bit is set.
-        while (length > 0) { 
-            sb.append(".");
-            int subId = 0;
-            boolean more;
-            
-            do {
-                more = ((value[index] & 0x80) != 0 );
-                aByte = value[index++] & 0x7F;
-                subId = (subId << 7) | aByte;
-            } while (--length > 0 && more );
+        int subId = 0;
+        boolean more;
+
+        for( int i = index; i < length; i++ ) {
+            more = ((value[i] & 0x80) != 0 );
+            aByte = value[i] & 0x7F;
+            subId = (subId << 7) | aByte;
 
-            sb.append(subId);
+            if( !more ) {
+                sb.append('.');
+                sb.append( subId );
+                subId = 0;
+            }
         }
 
         String result = sb.toString();
         return (result);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.snickers.asn.ASNDecoder#decodeSequence(int[])
+	 */
+	public Integer decodeSequence(int[] value) {
+		// TODO Auto-generated method stub
+		return null;
 	}
 
 }

Mime
View raw message