directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r159464 - directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/tlv/Value.java
Date Wed, 30 Mar 2005 06:30:44 GMT
Author: elecharny
Date: Tue Mar 29 22:30:41 2005
New Revision: 159464

URL: http://svn.apache.org/viewcvs?view=rev&rev=159464
Log:
Corrected a bug in Value : I was using the wrong method for bulk copy of a block of bytes
from a ByteBuffer. 
Fixed the current length handling in partial decoding

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/tlv/Value.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/tlv/Value.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/tlv/Value.java?view=diff&r1=159463&r2=159464
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/tlv/Value.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ber/tlv/Value.java Tue
Mar 29 22:30:41 2005
@@ -90,8 +90,9 @@
      */
     public void setData( ByteBuffer data )
     {
-    	data.put(this.data, 0, data.remaining());
-        currentPos = this.data.length;
+    	int length = data.remaining();
+    	data.get(this.data, 0, length);
+    	currentPos = length;
     }
 
     /**
@@ -101,8 +102,9 @@
      */
     public void addData( ByteBuffer data )
     {
-    	data.put(this.data , currentPos, data.remaining());
-        currentPos = this.data.length;
+    	int length = data.remaining();
+    	data.get(this.data , currentPos, length);
+    	currentPos += length;
     }
 
     /**
@@ -124,7 +126,7 @@
     public void addData( byte[] data )
     {
         System.arraycopy( data, 0, this.data, currentPos, data.length );
-        currentPos += data.length;
+        currentPos = data.length;
     }
 
     /**



Mime
View raw message