You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/06/11 13:41:18 UTC

svn commit: r546103 - /activemq/activemq-cpp/trunk/src/main/activemq/io/ByteArrayInputStream.cpp

Author: tabish
Date: Mon Jun 11 04:41:17 2007
New Revision: 546103

URL: http://svn.apache.org/viewvc?view=rev&rev=546103
Log:
https://issues.apache.org/activemq/browse/AMQCPP-103

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/io/ByteArrayInputStream.cpp

Modified: activemq/activemq-cpp/trunk/src/main/activemq/io/ByteArrayInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/io/ByteArrayInputStream.cpp?view=diff&rev=546103&r1=546102&r2=546103
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/io/ByteArrayInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/io/ByteArrayInputStream.cpp Mon Jun 11 04:41:17 2007
@@ -59,10 +59,11 @@
     activeBuffer = &defaultBuffer;
 
     // Remove old data
-    defaultBuffer.resize( lbufferSize );
+    defaultBuffer.clear();
+    defaultBuffer.reserve( lbufferSize );
 
-    // Copy to internal buffer
-    std::copy( lbuffer, lbuffer + lbufferSize, &defaultBuffer[0] );
+    // Copy data to internal buffer.
+    defaultBuffer.insert( defaultBuffer.end(), lbuffer, lbuffer + lbufferSize );
 
     // Begin at the Beginning.
     reset();