activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r439108 - /incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/packet/ByteBufferPacket.java
Date Fri, 01 Sep 2006 00:00:50 GMT
Author: chirino
Date: Thu Aug 31 17:00:49 2006
New Revision: 439108

URL: http://svn.apache.org/viewvc?rev=439108&view=rev
Log:
implement toByteSequence on direct byte buffers too.. needed for http://issues.apache.org/activemq/browse/AMQ-907

Modified:
    incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/packet/ByteBufferPacket.java

Modified: incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/packet/ByteBufferPacket.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/packet/ByteBufferPacket.java?rev=439108&r1=439107&r2=439108&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/packet/ByteBufferPacket.java
(original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/main/java/org/apache/activeio/packet/ByteBufferPacket.java
Thu Aug 31 17:00:49 2006
@@ -222,9 +222,13 @@
         if( buffer.hasArray() ) {
             byte[] bs = buffer.array();
             return new ByteSequence(bs, buffer.position(), buffer.remaining());
+        } else {
+            byte[] bs = new byte[buffer.remaining()];
+        	int p = buffer.position();
+        	buffer.get(bs);
+        	buffer.position(p);
+        	return new ByteSequence(bs, 0, bs.length);
         }
-        // TODO: implement the direct case.
-        return null;
     }
     
     /**



Mime
View raw message