activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r911562 [1/3] - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/activemq/commands/ main/activemq/io/ main/activemq/wireformat/openwire/ main/activemq/wireformat/openwire/marshal/v1/ main/activemq/wireformat/openwire/marshal/v2/ main/...
Date Thu, 18 Feb 2010 20:34:51 GMT
Author: tabish
Date: Thu Feb 18 20:34:48 2010
New Revision: 911562

URL: http://svn.apache.org/viewvc?rev=911562&view=rev
Log:
Refinements to the Decaf IO API.  Allows for better error checking on array access.  Improves the usage of some STL code that was quite inefficient.  Clean up some of the documentation in the headers as well.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingOutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/MessageMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/PartialCommandMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/WireFormatInfoMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/XATransactionIdMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/MessageMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/PartialCommandMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/WireFormatInfoMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/XATransactionIdMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/MessageMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/PartialCommandMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/WireFormatInfoMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/XATransactionIdMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/MessageMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/PartialCommandMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/WireFormatInfoMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/XATransactionIdMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/MessageMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/PartialCommandMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/WireFormatInfoMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshaller.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/BooleanStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/OpenwireStringSupport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompFrame.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/io/StandardErrorOutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/io/StandardErrorOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/FilterInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/FilterOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStreamReader.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStreamReader.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/OutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/OutputStreamWriter.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/OutputStreamWriter.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/SocketInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/SocketInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/SocketOutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/net/SocketOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Properties.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/logging/StreamHandler.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/io/ByteArrayInputStreamBenchmark.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test-benchmarks/decaf/io/ByteArrayOutputStreamBenchmark.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/BufferedInputStreamTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/BufferedOutputStreamTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/ByteArrayInputStreamTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/ByteArrayOutputStreamTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/DataInputStreamTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/DataOutputStreamTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/FilterInputStreamTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/FilterOutputStreamTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/InputStreamReaderTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/OutputStreamWriterTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/OutputStreamWriterTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/ReaderTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/io/WriterTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/SocketFactoryTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/SocketTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/net/SocketTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp Thu Feb 18 20:34:48 2010
@@ -93,7 +93,7 @@
     try{
 
         initializeWriting();
-        dataOut->write( buffer, 0, numBytes );
+        dataOut->write( buffer, numBytes, 0, numBytes );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -254,7 +254,7 @@
         std::size_t n = 0;
 
         while( n < length ) {
-            int count = this->dataIn->read( buffer, n, length - n );
+            int count = this->dataIn->read( buffer, length, n, length - n );
             if( count < 0 ) {
                 break;
             }
@@ -282,7 +282,7 @@
 
     initializeWriting();
     try{
-        this->dataOut->write( value, offset, length );
+        this->dataOut->write( value, length, offset, length );
     } catch( EOFException& ex ) {
         throw CMSExceptionSupport::createMessageEOFException( ex );
     } catch( Exception& ex ) {

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp Thu Feb 18 20:34:48 2010
@@ -276,9 +276,11 @@
 
     initializeWriting();
     try{
+
+        std::size_t size = value.size();
         this->dataOut->write( PrimitiveValueNode::BYTE_ARRAY_TYPE );
-        this->dataOut->writeInt( (int)value.size() );
-        this->dataOut->write( &value[0], 0, value.size() );
+        this->dataOut->writeInt( (int)size );
+        this->dataOut->write( &value[0], size, 0, size );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }
@@ -324,7 +326,7 @@
             return length;
         } else {
             // big buffer
-            int rc = this->dataIn->read( buffer, 0, this->remainingBytes );
+            int rc = this->dataIn->read( buffer, length, 0, this->remainingBytes );
             this->remainingBytes = 0;
             return rc;
         }
@@ -348,7 +350,7 @@
     try{
         this->dataOut->write( PrimitiveValueNode::BYTE_ARRAY_TYPE );
         this->dataOut->writeInt( (int)length );
-        this->dataOut->write( value, offset, length );
+        this->dataOut->write( value, length, offset, length );
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.cpp Thu Feb 18 20:34:48 2010
@@ -48,20 +48,30 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int LoggingInputStream::read( unsigned char* buffer,
-                              std::size_t offset,
-                              std::size_t bufferSize )
-    throw ( IOException, NullPointerException )
-{
+int LoggingInputStream::read( unsigned char* buffer, std::size_t size, std::size_t offset, std::size_t length )
+    throw ( decaf::io::IOException,
+            decaf::lang::exceptions::IndexOutOfBoundsException,
+            decaf::lang::exceptions::NullPointerException ) {
+
     try {
 
+        if( length == 0 ) {
+            return 0;
+        }
+
         if( buffer == NULL ) {
             throw NullPointerException(
                 __FILE__, __LINE__,
                 "LoggingInputStream::read - Passed Buffer is Null" );
         }
 
-        std::size_t numRead = FilterInputStream::read( buffer, offset, bufferSize );
+        if( length > size - offset ) {
+            throw IndexOutOfBoundsException(
+                __FILE__, __LINE__,
+                "Given size{%d} - offset{%d} is less than length{%d}.", size, offset, length );
+        }
+
+        std::size_t numRead = FilterInputStream::read( buffer, size, offset, length );
 
         log( buffer, numRead );
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.h?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingInputStream.h Thu Feb 18 20:34:48 2010
@@ -62,10 +62,10 @@
          * @throws IOException thrown if an error occurs.
          * @throws NullPointerException if buffer is null
          */
-        virtual int read( unsigned char* buffer,
-                          std::size_t offset,
-                          std::size_t bufferSize )
+        virtual int read( unsigned char* buffer, std::size_t size,
+                          std::size_t offset, std::size_t length )
             throw ( decaf::io::IOException,
+                    decaf::lang::exceptions::IndexOutOfBoundsException,
                     decaf::lang::exceptions::NullPointerException );
 
     private:

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingOutputStream.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingOutputStream.cpp Thu Feb 18 20:34:48 2010
@@ -47,24 +47,37 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void LoggingOutputStream::write( const unsigned char* buffer,
-                                 size_t offset,
-                                 size_t len )
-    throw ( IOException, NullPointerException ) {
+void LoggingOutputStream::write( const unsigned char* buffer, std::size_t size,
+                                 std::size_t offset, std::size_t length )
+    throw ( decaf::io::IOException,
+            decaf::lang::exceptions::NullPointerException,
+            decaf::lang::exceptions::IndexOutOfBoundsException ) {
 
     try {
 
+        if( length == 0 ) {
+            return;
+        }
+
         if( buffer == NULL ) {
             throw NullPointerException(
                 __FILE__, __LINE__,
                 "LoggingOutputStream::write - Passed Buffer is Null" );
         }
 
-        log( buffer, len );
+        if( ( offset + length ) > size ) {
+            throw decaf::lang::exceptions::IndexOutOfBoundsException(
+                __FILE__, __LINE__,
+                "DataOutputStream::write - given offset + length is greater than buffer size.");
+        }
+
+        log( buffer + offset, length );
 
-        FilterOutputStream::write( buffer, offset, len );
+        FilterOutputStream::write( buffer, size, offset, length );
     }
     AMQ_CATCH_RETHROW( IOException )
+    AMQ_CATCH_RETHROW( NullPointerException )
+    AMQ_CATCH_RETHROW( IndexOutOfBoundsException )
     AMQ_CATCHALL_THROW( IOException )
 }
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingOutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingOutputStream.h?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingOutputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/io/LoggingOutputStream.h Thu Feb 18 20:34:48 2010
@@ -57,18 +57,28 @@
         virtual void write( unsigned char c ) throw ( decaf::io::IOException );
 
         /**
-         * Writes an array of bytes to the output stream.
-         * @param buffer The array of bytes to write.
-         * @param offset the position in the buffer to start at
-         * @param len The number of bytes from the buffer to be written.
-         * @throws IOException thrown if an error occurs.
-         * @throws NullPointerException if buffer is null.
+         * Writes an array of bytes to the output stream in order starting at buffer[offset]
+         * and proceeding until the number of bytes specified by the length argument are
+         * written or an error occurs.
+         *
+         * @param buffer
+         *      The array of bytes to write.
+         * @param size
+         *      The size of the buffer array passed.
+         * @param offset
+         *      The position to start writing in buffer.
+         * @param length
+         *      The number of bytes from the buffer to be written.
+         *
+         * @throws IOException if an I/O error occurs.
+         * @throws NullPointerException thrown if buffer is Null.
+         * @throws IndexOutOfBoundsException if the offset + length > size.
          */
-        virtual void write( const unsigned char* buffer,
-                            std::size_t offset,
-                            std::size_t len )
+        virtual void write( const unsigned char* buffer, std::size_t size,
+                            std::size_t offset, std::size_t length )
             throw ( decaf::io::IOException,
-                    decaf::lang::exceptions::NullPointerException );
+                    decaf::lang::exceptions::NullPointerException,
+                    decaf::lang::exceptions::IndexOutOfBoundsException );
 
     private:
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/OpenWireFormat.cpp Thu Feb 18 20:34:48 2010
@@ -229,7 +229,7 @@
                 if( !sizePrefixDisabled ) {
                     looseOut->close();
                     dataOut->writeInt( (int)baos->size() );
-                    dataOut->write( baos->toByteArray(), 0, baos->size() );
+                    dataOut->write( baos->toByteArray(), baos->size(), 0, baos->size() );
 
                     // Delete allocated resource
                     delete baos;
@@ -412,7 +412,7 @@
 
             MarshalAware* ma = dynamic_cast< MarshalAware* >( o );
             vector<unsigned char> sequence = ma->getMarshaledForm( this );
-            ds->write( &sequence[0], 0, sequence.size() );
+            ds->write( sequence );
 
         } else {
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/MessageMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/MessageMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/MessageMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/MessageMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -167,11 +167,11 @@
         tightMarshalString2( info->getType(), dataOut, bs );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getContent().size() );
-            dataOut->write( (const unsigned char*)(&info->getContent()[0]), 0, (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), info->getContent().size(), 0, info->getContent().size() );
         }
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         tightMarshalNestedObject2( wireFormat, info->getDataStructure().get(), dataOut, bs );
         tightMarshalCachedObject2( wireFormat, info->getTargetConsumerId().get(), dataOut, bs );
@@ -273,12 +273,12 @@
         dataOut->write( info->getContent().size() != 0 );
         if( info->getContent().size() != 0 ) {
             dataOut->writeInt( (int)info->getContent().size() );
-            dataOut->write( (const unsigned char*)(&info->getContent()[0]), 0, (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), info->getContent().size(), 0, info->getContent().size() );
         }
         dataOut->write( info->getMarshalledProperties().size() != 0 );
         if( info->getMarshalledProperties().size() != 0 ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         looseMarshalNestedObject( wireFormat, info->getDataStructure().get(), dataOut );
         looseMarshalCachedObject( wireFormat, info->getTargetConsumerId().get(), dataOut );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/PartialCommandMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/PartialCommandMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/PartialCommandMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/PartialCommandMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -98,7 +98,7 @@
         dataOut->writeInt( info->getCommandId() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getData().size() );
-            dataOut->write( (const unsigned char*)(&info->getData()[0]), 0, (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), info->getData().size(), 0, info->getData().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
@@ -135,7 +135,7 @@
         dataOut->write( info->getData().size() != 0 );
         if( info->getData().size() != 0 ) {
             dataOut->writeInt( (int)info->getData().size() );
-            dataOut->write( (const unsigned char*)(&info->getData()[0]), 0, (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), info->getData().size(), 0, info->getData().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/WireFormatInfoMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/WireFormatInfoMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/WireFormatInfoMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/WireFormatInfoMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -101,11 +101,11 @@
 
         WireFormatInfo* info =
             dynamic_cast<WireFormatInfo*>( dataStructure );
-        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 0, 8 );
+        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
         dataOut->writeInt( info->getVersion() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         info->afterMarshal( wireFormat );
     }
@@ -143,12 +143,12 @@
         info->beforeMarshal( wireFormat );
         BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
 
-        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 0, (int)8 );
+        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
         dataOut->writeInt( info->getVersion() );
         dataOut->write( info->getMarshalledProperties().size() != 0 );
         if( info->getMarshalledProperties().size() != 0 ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         info->afterMarshal( wireFormat );
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/XATransactionIdMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/XATransactionIdMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/XATransactionIdMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v1/XATransactionIdMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -101,11 +101,11 @@
         dataOut->writeInt( info->getFormatId() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
-            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), 0, (int)info->getGlobalTransactionId().size() );
+            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), info->getGlobalTransactionId().size(), 0, info->getGlobalTransactionId().size() );
         }
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getBranchQualifier().size() );
-            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), 0, (int)info->getBranchQualifier().size() );
+            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), info->getBranchQualifier().size(), 0, info->getBranchQualifier().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
@@ -143,12 +143,12 @@
         dataOut->write( info->getGlobalTransactionId().size() != 0 );
         if( info->getGlobalTransactionId().size() != 0 ) {
             dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
-            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), 0, (int)info->getGlobalTransactionId().size() );
+            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), info->getGlobalTransactionId().size(), 0, info->getGlobalTransactionId().size() );
         }
         dataOut->write( info->getBranchQualifier().size() != 0 );
         if( info->getBranchQualifier().size() != 0 ) {
             dataOut->writeInt( (int)info->getBranchQualifier().size() );
-            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), 0, (int)info->getBranchQualifier().size() );
+            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), info->getBranchQualifier().size(), 0, info->getBranchQualifier().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/MessageMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/MessageMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/MessageMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/MessageMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -169,11 +169,11 @@
         tightMarshalString2( info->getType(), dataOut, bs );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getContent().size() );
-            dataOut->write( (const unsigned char*)(&info->getContent()[0]), 0, (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), info->getContent().size(), 0, info->getContent().size() );
         }
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         tightMarshalNestedObject2( wireFormat, info->getDataStructure().get(), dataOut, bs );
         tightMarshalCachedObject2( wireFormat, info->getTargetConsumerId().get(), dataOut, bs );
@@ -277,12 +277,12 @@
         dataOut->write( info->getContent().size() != 0 );
         if( info->getContent().size() != 0 ) {
             dataOut->writeInt( (int)info->getContent().size() );
-            dataOut->write( (const unsigned char*)(&info->getContent()[0]), 0, (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), info->getContent().size(), 0, info->getContent().size() );
         }
         dataOut->write( info->getMarshalledProperties().size() != 0 );
         if( info->getMarshalledProperties().size() != 0 ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         looseMarshalNestedObject( wireFormat, info->getDataStructure().get(), dataOut );
         looseMarshalCachedObject( wireFormat, info->getTargetConsumerId().get(), dataOut );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/PartialCommandMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/PartialCommandMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/PartialCommandMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/PartialCommandMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -98,7 +98,7 @@
         dataOut->writeInt( info->getCommandId() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getData().size() );
-            dataOut->write( (const unsigned char*)(&info->getData()[0]), 0, (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), info->getData().size(), 0, info->getData().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
@@ -135,7 +135,7 @@
         dataOut->write( info->getData().size() != 0 );
         if( info->getData().size() != 0 ) {
             dataOut->writeInt( (int)info->getData().size() );
-            dataOut->write( (const unsigned char*)(&info->getData()[0]), 0, (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), info->getData().size(), 0, info->getData().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/WireFormatInfoMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/WireFormatInfoMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/WireFormatInfoMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/WireFormatInfoMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -101,11 +101,11 @@
 
         WireFormatInfo* info =
             dynamic_cast<WireFormatInfo*>( dataStructure );
-        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 0, 8 );
+        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
         dataOut->writeInt( info->getVersion() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         info->afterMarshal( wireFormat );
     }
@@ -143,12 +143,12 @@
         info->beforeMarshal( wireFormat );
         BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
 
-        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 0, (int)8 );
+        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
         dataOut->writeInt( info->getVersion() );
         dataOut->write( info->getMarshalledProperties().size() != 0 );
         if( info->getMarshalledProperties().size() != 0 ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         info->afterMarshal( wireFormat );
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/XATransactionIdMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/XATransactionIdMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/XATransactionIdMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v2/XATransactionIdMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -101,11 +101,11 @@
         dataOut->writeInt( info->getFormatId() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
-            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), 0, (int)info->getGlobalTransactionId().size() );
+            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), info->getGlobalTransactionId().size(), 0, info->getGlobalTransactionId().size() );
         }
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getBranchQualifier().size() );
-            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), 0, (int)info->getBranchQualifier().size() );
+            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), info->getBranchQualifier().size(), 0, info->getBranchQualifier().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
@@ -143,12 +143,12 @@
         dataOut->write( info->getGlobalTransactionId().size() != 0 );
         if( info->getGlobalTransactionId().size() != 0 ) {
             dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
-            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), 0, (int)info->getGlobalTransactionId().size() );
+            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), info->getGlobalTransactionId().size(), 0, info->getGlobalTransactionId().size() );
         }
         dataOut->write( info->getBranchQualifier().size() != 0 );
         if( info->getBranchQualifier().size() != 0 ) {
             dataOut->writeInt( (int)info->getBranchQualifier().size() );
-            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), 0, (int)info->getBranchQualifier().size() );
+            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), info->getBranchQualifier().size(), 0, info->getBranchQualifier().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/MessageMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/MessageMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/MessageMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/MessageMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -186,11 +186,11 @@
         tightMarshalString2( info->getType(), dataOut, bs );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getContent().size() );
-            dataOut->write( (const unsigned char*)(&info->getContent()[0]), 0, (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), info->getContent().size(), 0, info->getContent().size() );
         }
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         tightMarshalNestedObject2( wireFormat, info->getDataStructure().get(), dataOut, bs );
         tightMarshalCachedObject2( wireFormat, info->getTargetConsumerId().get(), dataOut, bs );
@@ -311,12 +311,12 @@
         dataOut->write( info->getContent().size() != 0 );
         if( info->getContent().size() != 0 ) {
             dataOut->writeInt( (int)info->getContent().size() );
-            dataOut->write( (const unsigned char*)(&info->getContent()[0]), 0, (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), info->getContent().size(), 0, info->getContent().size() );
         }
         dataOut->write( info->getMarshalledProperties().size() != 0 );
         if( info->getMarshalledProperties().size() != 0 ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         looseMarshalNestedObject( wireFormat, info->getDataStructure().get(), dataOut );
         looseMarshalCachedObject( wireFormat, info->getTargetConsumerId().get(), dataOut );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/PartialCommandMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/PartialCommandMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/PartialCommandMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/PartialCommandMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -98,7 +98,7 @@
         dataOut->writeInt( info->getCommandId() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getData().size() );
-            dataOut->write( (const unsigned char*)(&info->getData()[0]), 0, (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), info->getData().size(), 0, info->getData().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
@@ -135,7 +135,7 @@
         dataOut->write( info->getData().size() != 0 );
         if( info->getData().size() != 0 ) {
             dataOut->writeInt( (int)info->getData().size() );
-            dataOut->write( (const unsigned char*)(&info->getData()[0]), 0, (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), info->getData().size(), 0, info->getData().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/WireFormatInfoMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/WireFormatInfoMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/WireFormatInfoMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/WireFormatInfoMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -101,11 +101,11 @@
 
         WireFormatInfo* info =
             dynamic_cast<WireFormatInfo*>( dataStructure );
-        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 0, 8 );
+        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
         dataOut->writeInt( info->getVersion() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         info->afterMarshal( wireFormat );
     }
@@ -143,12 +143,12 @@
         info->beforeMarshal( wireFormat );
         BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
 
-        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 0, (int)8 );
+        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
         dataOut->writeInt( info->getVersion() );
         dataOut->write( info->getMarshalledProperties().size() != 0 );
         if( info->getMarshalledProperties().size() != 0 ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         info->afterMarshal( wireFormat );
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/XATransactionIdMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/XATransactionIdMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/XATransactionIdMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v3/XATransactionIdMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -101,11 +101,11 @@
         dataOut->writeInt( info->getFormatId() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
-            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), 0, (int)info->getGlobalTransactionId().size() );
+            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), info->getGlobalTransactionId().size(), 0, info->getGlobalTransactionId().size() );
         }
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getBranchQualifier().size() );
-            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), 0, (int)info->getBranchQualifier().size() );
+            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), info->getBranchQualifier().size(), 0, info->getBranchQualifier().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
@@ -143,12 +143,12 @@
         dataOut->write( info->getGlobalTransactionId().size() != 0 );
         if( info->getGlobalTransactionId().size() != 0 ) {
             dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
-            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), 0, (int)info->getGlobalTransactionId().size() );
+            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), info->getGlobalTransactionId().size(), 0, info->getGlobalTransactionId().size() );
         }
         dataOut->write( info->getBranchQualifier().size() != 0 );
         if( info->getBranchQualifier().size() != 0 ) {
             dataOut->writeInt( (int)info->getBranchQualifier().size() );
-            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), 0, (int)info->getBranchQualifier().size() );
+            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), info->getBranchQualifier().size(), 0, info->getBranchQualifier().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/MessageMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/MessageMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/MessageMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/MessageMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -186,11 +186,11 @@
         tightMarshalString2( info->getType(), dataOut, bs );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getContent().size() );
-            dataOut->write( (const unsigned char*)(&info->getContent()[0]), 0, (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), info->getContent().size(), 0, info->getContent().size() );
         }
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         tightMarshalNestedObject2( wireFormat, info->getDataStructure().get(), dataOut, bs );
         tightMarshalCachedObject2( wireFormat, info->getTargetConsumerId().get(), dataOut, bs );
@@ -311,12 +311,12 @@
         dataOut->write( info->getContent().size() != 0 );
         if( info->getContent().size() != 0 ) {
             dataOut->writeInt( (int)info->getContent().size() );
-            dataOut->write( (const unsigned char*)(&info->getContent()[0]), 0, (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), info->getContent().size(), 0, info->getContent().size() );
         }
         dataOut->write( info->getMarshalledProperties().size() != 0 );
         if( info->getMarshalledProperties().size() != 0 ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         looseMarshalNestedObject( wireFormat, info->getDataStructure().get(), dataOut );
         looseMarshalCachedObject( wireFormat, info->getTargetConsumerId().get(), dataOut );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/PartialCommandMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/PartialCommandMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/PartialCommandMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/PartialCommandMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -98,7 +98,7 @@
         dataOut->writeInt( info->getCommandId() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getData().size() );
-            dataOut->write( (const unsigned char*)(&info->getData()[0]), 0, (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), info->getData().size(), 0, info->getData().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
@@ -135,7 +135,7 @@
         dataOut->write( info->getData().size() != 0 );
         if( info->getData().size() != 0 ) {
             dataOut->writeInt( (int)info->getData().size() );
-            dataOut->write( (const unsigned char*)(&info->getData()[0]), 0, (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), info->getData().size(), 0, info->getData().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/WireFormatInfoMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/WireFormatInfoMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/WireFormatInfoMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/WireFormatInfoMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -101,11 +101,11 @@
 
         WireFormatInfo* info =
             dynamic_cast<WireFormatInfo*>( dataStructure );
-        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 0, 8 );
+        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
         dataOut->writeInt( info->getVersion() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         info->afterMarshal( wireFormat );
     }
@@ -143,12 +143,12 @@
         info->beforeMarshal( wireFormat );
         BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
 
-        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 0, (int)8 );
+        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
         dataOut->writeInt( info->getVersion() );
         dataOut->write( info->getMarshalledProperties().size() != 0 );
         if( info->getMarshalledProperties().size() != 0 ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         info->afterMarshal( wireFormat );
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/XATransactionIdMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/XATransactionIdMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/XATransactionIdMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v4/XATransactionIdMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -101,11 +101,11 @@
         dataOut->writeInt( info->getFormatId() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
-            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), 0, (int)info->getGlobalTransactionId().size() );
+            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), info->getGlobalTransactionId().size(), 0, info->getGlobalTransactionId().size() );
         }
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getBranchQualifier().size() );
-            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), 0, (int)info->getBranchQualifier().size() );
+            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), info->getBranchQualifier().size(), 0, info->getBranchQualifier().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
@@ -143,12 +143,12 @@
         dataOut->write( info->getGlobalTransactionId().size() != 0 );
         if( info->getGlobalTransactionId().size() != 0 ) {
             dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
-            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), 0, (int)info->getGlobalTransactionId().size() );
+            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), info->getGlobalTransactionId().size(), 0, info->getGlobalTransactionId().size() );
         }
         dataOut->write( info->getBranchQualifier().size() != 0 );
         if( info->getBranchQualifier().size() != 0 ) {
             dataOut->writeInt( (int)info->getBranchQualifier().size() );
-            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), 0, (int)info->getBranchQualifier().size() );
+            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), info->getBranchQualifier().size(), 0, info->getBranchQualifier().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/MessageMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/MessageMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/MessageMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/MessageMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -186,11 +186,11 @@
         tightMarshalString2( info->getType(), dataOut, bs );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getContent().size() );
-            dataOut->write( (const unsigned char*)(&info->getContent()[0]), 0, (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), info->getContent().size(), 0, info->getContent().size() );
         }
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         tightMarshalNestedObject2( wireFormat, info->getDataStructure().get(), dataOut, bs );
         tightMarshalCachedObject2( wireFormat, info->getTargetConsumerId().get(), dataOut, bs );
@@ -311,12 +311,12 @@
         dataOut->write( info->getContent().size() != 0 );
         if( info->getContent().size() != 0 ) {
             dataOut->writeInt( (int)info->getContent().size() );
-            dataOut->write( (const unsigned char*)(&info->getContent()[0]), 0, (int)info->getContent().size() );
+            dataOut->write( (const unsigned char*)(&info->getContent()[0]), info->getContent().size(), 0, info->getContent().size() );
         }
         dataOut->write( info->getMarshalledProperties().size() != 0 );
         if( info->getMarshalledProperties().size() != 0 ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         looseMarshalNestedObject( wireFormat, info->getDataStructure().get(), dataOut );
         looseMarshalCachedObject( wireFormat, info->getTargetConsumerId().get(), dataOut );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/PartialCommandMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/PartialCommandMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/PartialCommandMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/PartialCommandMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -98,7 +98,7 @@
         dataOut->writeInt( info->getCommandId() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getData().size() );
-            dataOut->write( (const unsigned char*)(&info->getData()[0]), 0, (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), info->getData().size(), 0, info->getData().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
@@ -135,7 +135,7 @@
         dataOut->write( info->getData().size() != 0 );
         if( info->getData().size() != 0 ) {
             dataOut->writeInt( (int)info->getData().size() );
-            dataOut->write( (const unsigned char*)(&info->getData()[0]), 0, (int)info->getData().size() );
+            dataOut->write( (const unsigned char*)(&info->getData()[0]), info->getData().size(), 0, info->getData().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/WireFormatInfoMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/WireFormatInfoMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/WireFormatInfoMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/WireFormatInfoMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -101,11 +101,11 @@
 
         WireFormatInfo* info =
             dynamic_cast<WireFormatInfo*>( dataStructure );
-        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 0, 8 );
+        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
         dataOut->writeInt( info->getVersion() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         info->afterMarshal( wireFormat );
     }
@@ -143,12 +143,12 @@
         info->beforeMarshal( wireFormat );
         BaseDataStreamMarshaller::looseMarshal( wireFormat, dataStructure, dataOut );
 
-        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 0, (int)8 );
+        dataOut->write( (const unsigned char*)(&info->getMagic()[0]), 8, 0, 8 );
         dataOut->writeInt( info->getVersion() );
         dataOut->write( info->getMarshalledProperties().size() != 0 );
         if( info->getMarshalledProperties().size() != 0 ) {
             dataOut->writeInt( (int)info->getMarshalledProperties().size() );
-            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), 0, (int)info->getMarshalledProperties().size() );
+            dataOut->write( (const unsigned char*)(&info->getMarshalledProperties()[0]), info->getMarshalledProperties().size(), 0, info->getMarshalledProperties().size() );
         }
         info->afterMarshal( wireFormat );
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshaller.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/v5/XATransactionIdMarshaller.cpp Thu Feb 18 20:34:48 2010
@@ -101,11 +101,11 @@
         dataOut->writeInt( info->getFormatId() );
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
-            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), 0, (int)info->getGlobalTransactionId().size() );
+            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), info->getGlobalTransactionId().size(), 0, info->getGlobalTransactionId().size() );
         }
         if( bs->readBoolean() ) {
             dataOut->writeInt( (int)info->getBranchQualifier().size() );
-            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), 0, (int)info->getBranchQualifier().size() );
+            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), info->getBranchQualifier().size(), 0, info->getBranchQualifier().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
@@ -143,12 +143,12 @@
         dataOut->write( info->getGlobalTransactionId().size() != 0 );
         if( info->getGlobalTransactionId().size() != 0 ) {
             dataOut->writeInt( (int)info->getGlobalTransactionId().size() );
-            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), 0, (int)info->getGlobalTransactionId().size() );
+            dataOut->write( (const unsigned char*)(&info->getGlobalTransactionId()[0]), info->getGlobalTransactionId().size(), 0, info->getGlobalTransactionId().size() );
         }
         dataOut->write( info->getBranchQualifier().size() != 0 );
         if( info->getBranchQualifier().size() != 0 ) {
             dataOut->writeInt( (int)info->getBranchQualifier().size() );
-            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), 0, (int)info->getBranchQualifier().size() );
+            dataOut->write( (const unsigned char*)(&info->getBranchQualifier()[0]), info->getBranchQualifier().size(), 0, info->getBranchQualifier().size() );
         }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/BooleanStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/BooleanStream.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/BooleanStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/BooleanStream.cpp Thu Feb 18 20:34:48 2010
@@ -106,7 +106,7 @@
         }
 
         // Dump the payload
-        dataOut->write( &data[0], 0, arrayLimit );
+        dataOut->write( &data[0], data.size(), 0, arrayLimit );
         clear();
     }
     AMQ_CATCH_RETHROW( IOException )
@@ -131,8 +131,7 @@
         }
 
         // Insert all data from data into the passed buffer
-        std::back_insert_iterator< std::vector<unsigned char> > iter( dataOut );
-        std::copy( &data[0], &data[arrayLimit-1], iter );
+        dataOut.insert( dataOut.end(), &data[0], &data[arrayLimit-1] );
     }
     AMQ_CATCH_RETHROW( IOException )
     AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/OpenwireStringSupport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/OpenwireStringSupport.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/OpenwireStringSupport.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/utils/OpenwireStringSupport.cpp Thu Feb 18 20:34:48 2010
@@ -177,7 +177,7 @@
             }
 
             dataOut.writeInt( utfLength );
-            dataOut.write( &utfBytes[0], 0, utfLength );
+            dataOut.write( &utfBytes[0], utfLength, 0, utfLength );
 
         } else {
             dataOut.writeInt( -1 );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompFrame.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompFrame.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompFrame.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/StompFrame.cpp Thu Feb 18 20:34:48 2010
@@ -56,10 +56,10 @@
 
     // Remove old data
     body.clear();
+    body.reserve( numBytes );
 
     // Copy data to internal buffer.
-    std::back_insert_iterator< std::vector<unsigned char> > iter( body );
-    std::copy( bytes, bytes + numBytes, iter );
+    this->body.insert( this->body.begin(), bytes, bytes + numBytes );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -73,7 +73,7 @@
 
     // Write the command.
     const string& cmdString = this->getCommand();
-    stream->write( (unsigned char*)cmdString.c_str(), 0, cmdString.length() );
+    stream->write( (unsigned char*)cmdString.c_str(), cmdString.length(), 0, cmdString.length() );
     stream->write( '\n' );
 
     // Write all the headers.
@@ -82,9 +82,9 @@
         string& name = headers[ix].first;
         string& value = headers[ix].second;
 
-        stream->write( (unsigned char*)name.c_str(), 0, name.length() );
+        stream->write( (unsigned char*)name.c_str(), name.length(), 0, name.length() );
         stream->write( ':' );
-        stream->write( (unsigned char*)value.c_str(), 0, value.length() );
+        stream->write( (unsigned char*)value.c_str(), value.length(), 0, value.length() );
         stream->write( '\n' );
     }
 
@@ -94,7 +94,7 @@
     // Write the body.
     const std::vector<unsigned char>& body = this->getBody();
     if( body.size() > 0 ) {
-        stream->write( &body[0], 0, body.size() );
+        stream->write( &body[0], body.size(), 0, body.size() );
     }
 
     if( ( this->getBodyLength() == 0 ) ||
@@ -302,7 +302,7 @@
             this->body.resize( (std::size_t)content_length );
 
             // Read the Content Length now
-            in->read( &body[0], 0, content_length );
+            in->read( &body[0], body.size(), 0, content_length );
 
             // Content Length read, now pop the end terminator off (\0\n).
             if( in->readByte() != '\0' ) {

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/io/StandardErrorOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/io/StandardErrorOutputStream.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/io/StandardErrorOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/io/StandardErrorOutputStream.cpp Thu Feb 18 20:34:48 2010
@@ -48,14 +48,19 @@
         return;
     }
 
-    this->write( &buffer[0], 0, buffer.size() );
+    this->write( &buffer[0], buffer.size(), 0, buffer.size() );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void StandardErrorOutputStream::write( const unsigned char* buffer,
-                                       std::size_t offset,
-                                       std::size_t len )
-    throw ( decaf::io::IOException, lang::exceptions::NullPointerException ) {
+void StandardErrorOutputStream::write( const unsigned char* buffer, std::size_t size,
+                                       std::size_t offset, std::size_t length )
+    throw ( decaf::io::IOException,
+            decaf::lang::exceptions::NullPointerException,
+            decaf::lang::exceptions::IndexOutOfBoundsException ) {
+
+    if( length == 0 ) {
+        return;
+    }
 
     if( buffer == NULL ) {
         throw lang::exceptions::NullPointerException(
@@ -63,13 +68,13 @@
             "StandardErrorOutputStream::write - Passed buffer is null." );
     }
 
-    if( offset > len ) {
-        throw decaf::io::IOException(
+    if( ( offset + length ) > size ) {
+        throw decaf::lang::exceptions::IndexOutOfBoundsException(
             __FILE__, __LINE__,
-            "StandardErrorOutputStream::write - offset passed is greater than length" );
+            "StandardErrorOutputStream::write - given offset + length is greater than buffer size.");
     }
 
-	for( std::size_t i = 0; i < len; ++i ) {
+    for( std::size_t i = 0; i < length; ++i ) {
         std::cerr << buffer[i+offset];
     }
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/io/StandardErrorOutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/io/StandardErrorOutputStream.h?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/io/StandardErrorOutputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/io/StandardErrorOutputStream.h Thu Feb 18 20:34:48 2010
@@ -64,22 +64,28 @@
             throw ( decaf::io::IOException );
 
         /**
-         * Writes an array of bytes to the output stream.
+         * Writes an array of bytes to the output stream in order starting at buffer[offset]
+         * and proceeding until the number of bytes specified by the length argument are
+         * written or an error occurs.
          *
          * @param buffer
          *      The array of bytes to write.
+         * @param size
+         *      The size of the buffer array passed.
          * @param offset
          *      The position to start writing in buffer.
-         * @param len
+         * @param length
          *      The number of bytes from the buffer to be written.
          *
-         * @throws decaf::io::IOException thrown if an error occurs.
-         * @throws NullPointerException if buffer is null.
+         * @throws IOException if an I/O error occurs.
+         * @throws NullPointerException thrown if buffer is Null.
+         * @throws IndexOutOfBoundsException if the offset + length > size.
          */
-        virtual void write( const unsigned char* buffer,
-                            std::size_t offset,
-                            std::size_t len )
-            throw ( decaf::io::IOException, lang::exceptions::NullPointerException );
+        virtual void write( const unsigned char* buffer, std::size_t size,
+                            std::size_t offset, std::size_t length )
+            throw ( decaf::io::IOException,
+                    decaf::lang::exceptions::NullPointerException,
+                    decaf::lang::exceptions::IndexOutOfBoundsException );
 
         /**
          * Invokes flush on the target output stream.

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.cpp Thu Feb 18 20:34:48 2010
@@ -49,15 +49,14 @@
     synchronized( this ){
 
         // Remove old data
-        buffer.clear();
-        buffer.reserve( lbufferSize );
+        this->buffer.clear();
+        this->buffer.reserve( lbufferSize );
 
         // Copy data to internal buffer.
-        std::back_insert_iterator< std::vector<unsigned char> > iter( buffer );
-        std::copy( lbuffer, lbuffer + lbufferSize, iter );
+        this->buffer.insert( this->buffer.begin(), lbuffer, lbuffer + lbufferSize );
 
         // Begin at the Beginning.
-        pos = this->buffer.begin();
+        this->pos = this->buffer.begin();
 
         // Notify any listening threds that there is now data available.
         notifyAll();
@@ -106,12 +105,13 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int BlockingByteArrayInputStream::read( unsigned char* buffer,
-                                        std::size_t offset,
-                                        std::size_t bufferSize )
-    throw ( IOException, lang::exceptions::NullPointerException ){
+int BlockingByteArrayInputStream::read( unsigned char* buffer, std::size_t size,
+                                        std::size_t offset, std::size_t length )
+    throw ( decaf::io::IOException,
+            decaf::lang::exceptions::IndexOutOfBoundsException,
+            decaf::lang::exceptions::NullPointerException ) {
 
-    if( bufferSize == 0 ) {
+    if( size == 0 || length == 0 ) {
         return 0;
     }
 
@@ -121,11 +121,17 @@
             "BlockingByteArrayInputStream::read - Passed buffer is Null" );
     }
 
+    if( length > size - offset ) {
+        throw IndexOutOfBoundsException(
+            __FILE__, __LINE__,
+            "Given size{%d} - offset{%d} is less than length{%d}.", size, offset, length );
+    }
+
     synchronized( this ){
 
         std::size_t ix = 0;
 
-        for( ; ix < bufferSize && !closing; ++ix ) {
+        for( ; ix < length && !closing; ++ix ) {
 
             if( pos == this->buffer.end() ) {
                 // Wait for more data to come in.

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.h?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.h Thu Feb 18 20:34:48 2010
@@ -114,10 +114,11 @@
          * @return the number of bytes read. or -1 if EOF
          * @throws IOException f an error occurs.
          */
-        virtual int read( unsigned char* buffer,
-                          std::size_t offset,
-                          std::size_t bufferSize )
-            throw ( IOException, lang::exceptions::NullPointerException );
+        virtual int read( unsigned char* buffer, std::size_t size,
+                          std::size_t offset, std::size_t length )
+            throw ( decaf::io::IOException,
+                    decaf::lang::exceptions::IndexOutOfBoundsException,
+                    decaf::lang::exceptions::NullPointerException );
 
         /**
          * Closes the target input stream.

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.cpp?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.cpp Thu Feb 18 20:34:48 2010
@@ -129,10 +129,10 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int BufferedInputStream::read( unsigned char* targetBuffer,
-                               std::size_t offset,
-                               std::size_t targetBufferSize )
-    throw ( IOException, NullPointerException ){
+int BufferedInputStream::read( unsigned char* buffer, std::size_t size, std::size_t offset, std::size_t length )
+    throw ( decaf::io::IOException,
+            decaf::lang::exceptions::IndexOutOfBoundsException,
+            decaf::lang::exceptions::NullPointerException ) {
 
     try{
 
@@ -143,14 +143,19 @@
         }
 
         // For zero, do nothing
-        if( targetBufferSize == 0 ) {
+        if( size == 0 || length == 0 ) {
             return 0;
         }
 
-        if( targetBuffer == NULL ) {
-            throw NullPointerException(
+        if( length > size - offset ) {
+            throw IndexOutOfBoundsException(
                 __FILE__, __LINE__,
-                "BufferedInputStream::read - Passed NULL for target Buffer");
+                "Given size{%d} - offset{%d} is less than length{%d}.", size, offset, length );
+        }
+
+        if( size - offset < length ) {
+            throw IndexOutOfBoundsException(
+                __FILE__, __LINE__, "Given size{%d} - offset{%d} > length{%d}.", size, offset, length );
         }
 
         // If there's no data left, reset to pointers to the beginning of the
@@ -160,13 +165,13 @@
         // If we still haven't filled the output buffer AND there is data
         // on the input stream to be read, read a buffer's worth from the stream.
         std::size_t totalRead = 0;
-        while( totalRead < targetBufferSize ){
+        while( totalRead < length ){
 
             // Get the remaining bytes to copy.
-            std::size_t bytesToCopy = min( tail-head, (targetBufferSize-totalRead) );
+            std::size_t bytesToCopy = min( tail-head, (length-totalRead) );
 
             // Copy the data to the output buffer.
-            memcpy( targetBuffer+totalRead+offset, this->buffer+head, bytesToCopy );
+            memcpy( buffer+totalRead+offset, this->buffer+head, bytesToCopy );
 
             // Increment the total bytes read.
             totalRead += bytesToCopy;
@@ -180,7 +185,7 @@
 
             // If we still haven't satisified the request,
             // read more data.
-            if( totalRead < targetBufferSize ){
+            if( totalRead < length ){
 
                 // Buffer as much data as we can, return EOF if we hit it.
                 if( bufferData() == -1 ) {
@@ -262,7 +267,7 @@
         std::size_t bytesToRead = max( (std::size_t)1, min( available, getUnusedBytes() ) );
 
         // Read the bytes from the input stream.
-        int bytesRead = inputStream->read( getTail(), 0, bytesToRead );
+        int bytesRead = inputStream->read( buffer, bufferSize, tail, bytesToRead );
         if( bytesRead == 0 ){
             throw IOException(
                 __FILE__, __LINE__,

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.h?rev=911562&r1=911561&r2=911562&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.h Thu Feb 18 20:34:48 2010
@@ -127,11 +127,11 @@
          * @throws IOException thrown if an error occurs.
          * @throws NullPointerException if buffer is NULL
          */
-        virtual int read( unsigned char* buffer,
-                          std::size_t offset,
-                          std::size_t bufferSize )
-            throw ( IOException,
-                    lang::exceptions::NullPointerException );
+        virtual int read( unsigned char* buffer, std::size_t size,
+                          std::size_t offset, std::size_t length )
+            throw ( decaf::io::IOException,
+                    decaf::lang::exceptions::IndexOutOfBoundsException,
+                    decaf::lang::exceptions::NullPointerException );
 
         /**
          * Skips over and discards n bytes of data from this input stream. The



Mime
View raw message