activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r551297 - in /activemq/activemq-cpp/trunk/src/decaf/src: examples/main.cpp main/decaf/io/DataInputStream.cpp
Date Wed, 27 Jun 2007 19:50:28 GMT
Author: tabish
Date: Wed Jun 27 12:50:27 2007
New Revision: 551297

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

Building Decaf lib

Modified:
    activemq/activemq-cpp/trunk/src/decaf/src/examples/main.cpp
    activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/DataInputStream.cpp

Modified: activemq/activemq-cpp/trunk/src/decaf/src/examples/main.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/examples/main.cpp?view=diff&rev=551297&r1=551296&r2=551297
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/examples/main.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/examples/main.cpp Wed Jun 27 12:50:27 2007
@@ -68,8 +68,10 @@
 
         startTime = Date::getCurrentTimeMilliseconds();
 
-        // Time a large read
-        std::string result = dis.readString();
+        char result = 0;
+        for( int iy = 0; iy < bufferSize; ++iy ){
+            result = dis.readChar();
+        }
 
         endTime = Date::getCurrentTimeMilliseconds();
 

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/DataInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/DataInputStream.cpp?view=diff&rev=551297&r1=551296&r2=551297
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/DataInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/io/DataInputStream.cpp Wed Jun 27
12:50:27 2007
@@ -124,8 +124,13 @@
 ////////////////////////////////////////////////////////////////////////////////
 char DataInputStream::readChar() throw ( IOException, EOFException ) {
     try {
-        char value = 0;
-        this->readFully( ( unsigned char* )&value, 0, sizeof( char ) );
+        unsigned char value = 0;
+        if( inputStream->read( &value, sizeof( char ) ) < (size_t)sizeof( char
) ) {
+            throw EOFException(
+                __FILE__, __LINE__,
+                "DataInputStream::readChar - Reached EOF" );
+        }
+
         return (char)( value );
     }
     DECAF_CATCH_RETHROW( EOFException )



Mime
View raw message