activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r599060 - /activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp
Date Wed, 28 Nov 2007 16:52:29 GMT
Author: tabish
Date: Wed Nov 28 08:52:28 2007
New Revision: 599060

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

Working on the NIO package

Modified:
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp

Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp?rev=599060&r1=599059&r2=599060&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/nio/ByteBuffer.cpp Wed Nov 28 08:52:28
2007
@@ -248,19 +248,18 @@
             return *this;
         }
 
-        if( length > this->remaining() ) {
-            throw BufferUnderflowException(
-                __FILE__, __LINE__,
-                "ByteBuffer::get - Not Enough Data to Fill Request.");
-        }
-
-
         if( buffer == NULL ) {
             throw NullPointerException(
                 __FILE__, __LINE__,
                 "ByteBuffer::get - Passed Buffer is Null.");
         }
 
+        if( length > this->remaining() ) {
+            throw BufferUnderflowException(
+                __FILE__, __LINE__,
+                "ByteBuffer::get - Not Enough Data to Fill Request.");
+        }
+
         // read length bytes starting from the offset
         for( std::size_t ix = 0; ix < length; ++ix ) {
             buffer[ix + offset] = this->get();
@@ -513,7 +512,7 @@
 
     try{
 
-        if( (offset + index) > this->limit() ) {
+        if( (offset + index) >= this->limit() ) {
             throw IndexOutOfBoundsException(
                 __FILE__, __LINE__,
                 "ByteBuffer::get - Not enough data to fill request." );



Mime
View raw message