activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r424272 [5/10] - in /incubator/activemq/trunk/activemq-cpp: ./ src/examples/ src/main/activemq/concurrent/ src/main/activemq/connector/ src/main/activemq/connector/stomp/ src/main/activemq/connector/stomp/commands/ src/main/activemq/connect...
Date Fri, 21 Jul 2006 11:36:16 GMT
Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/InvalidStateException.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/InvalidStateException.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/InvalidStateException.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/InvalidStateException.h Fri Jul 21 04:36:09 2006
@@ -22,70 +22,67 @@
 namespace activemq{
 namespace exceptions{
 
-   /*
-    * Thrown when an operation is requested, but the state of the object
-    * servicing the request is not correct for that request.
-    */
-   class InvalidStateException : public ActiveMQException
-   {
-   public:
-
-      /**
-       * Default Constructor
-       */
-   	  InvalidStateException(void) {}
-
-      /**
-       * Conversion Constructor from some other ActiveMQException
-       * @param An exception that should become this type of Exception
-       */
-      InvalidStateException(const ActiveMQException& ex){
-         *(ActiveMQException*)this = ex;
-      }
-
-      /**
-       * Copy Constructor
-       */
-      InvalidStateException(const InvalidStateException& ex){
-         *(ActiveMQException*)this = ex;
-      }
-
-      /**
-       * Constructor - Initializes the file name and line number where
-       * this message occured.  Sets the message to report, using an 
-       * optional list of arguments to parse into the message
-       * @param file name where exception occurs
-       * @param line number where the exception occurred.
-       * @param message to report
-       * @param list of primitives that are formatted into the message
-       */
-      InvalidStateException(const char* file, 
-                            const int lineNumber,
-                            const char* msg, ...)
-      {
-         va_list vargs;
-         va_start(vargs, msg);
-         buildMessage(msg, vargs);
+    /*
+     * Thrown when an operation is requested, but the state of the object
+     * servicing the request is not correct for that request.
+     */
+    class InvalidStateException : public ActiveMQException
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        InvalidStateException(void) {}
+
+        /**
+         * Conversion Constructor from some other ActiveMQException
+         * @param An exception that should become this type of Exception
+         */
+        InvalidStateException(const ActiveMQException& ex){
+            *(ActiveMQException*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        InvalidStateException( const InvalidStateException& ex ){
+            *(ActiveMQException*)this = ex;
+        }
+
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occured.  Sets the message to report, using an 
+         * optional list of arguments to parse into the message
+         * @param file name where exception occurs
+         * @param line number where the exception occurred.
+         * @param message to report
+         * @param list of primitives that are formatted into the message
+         */
+        InvalidStateException( const char* file, 
+                               const int lineNumber,
+                               const char* msg, ... )
+        {
+            va_list vargs;
+            va_start( vargs, msg );
+            buildMessage( msg, vargs );
             
-         // Set the first mark for this exception.
-         setMark(file, lineNumber);
-      }
-
-      /**
-       * Clones this exception.  This is useful for cases where you need
-       * to preserve the type of the original exception as well as the message.
-       * All subclasses should override.
-       */
-      virtual ActiveMQException* clone(void) const{
-         return new InvalidStateException(*this);
-      }
-
-      /**
-       * Destructor
-       */
-   	virtual ~InvalidStateException(void) {}
+            // Set the first mark for this exception.
+            setMark( file, lineNumber );
+        }
+
+        /**
+         * Clones this exception.  This is useful for cases where you need
+         * to preserve the type of the original exception as well as the message.
+         * All subclasses should override.
+         */
+        virtual ActiveMQException* clone(void) const{
+            return new InvalidStateException(*this);
+        }
+
+        virtual ~InvalidStateException(void) {}
       
-   };
+    };
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/NoSuchElementException.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/NoSuchElementException.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/NoSuchElementException.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/NoSuchElementException.h Fri Jul 21 04:36:09 2006
@@ -22,70 +22,67 @@
 namespace activemq{
 namespace exceptions{
 
-   /*
-    * Thrown from an operation that attempts to access some element that does
-    * not exist.
-    */
-   class NoSuchElementException : public ActiveMQException
-   {
-   public:
-
-      /**
-       * Default Constructor
-       */
-      NoSuchElementException(void) {};
-
-      /**
-       * Conversion Constructor from some other ActiveMQException
-       * @param An exception that should become this type of Exception
-       */
-      NoSuchElementException(const ActiveMQException& ex){
-         *(ActiveMQException*)this = ex;
-      }
-
-      /**
-       * Copy Constructor
-       */
-      NoSuchElementException(const NoSuchElementException& ex){
-         *(ActiveMQException*)this = ex;
-      }
-
-      /**
-       * Constructor - Initializes the file name and line number where
-       * this message occured.  Sets the message to report, using an 
-       * optional list of arguments to parse into the message
-       * @param file name where exception occurs
-       * @param line number where the exception occurred.
-       * @param message to report
-       * @param list of primitives that are formatted into the message
-       */
-      NoSuchElementException(const char* file, 
-                             const int lineNumber,
-                             const char* msg, ...)
-      {
-         va_list vargs;
-         va_start(vargs, msg);
-         buildMessage(msg, vargs);
+    /*
+     * Thrown from an operation that attempts to access some element that does
+     * not exist.
+     */
+    class NoSuchElementException : public ActiveMQException
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        NoSuchElementException(void) {};
+
+        /**
+         * Conversion Constructor from some other ActiveMQException
+         * @param An exception that should become this type of Exception
+         */
+        NoSuchElementException( const ActiveMQException& ex ){
+            *(ActiveMQException*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        NoSuchElementException( const NoSuchElementException& ex ){
+            *(ActiveMQException*)this = ex;
+        }
+
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occured.  Sets the message to report, using an 
+         * optional list of arguments to parse into the message
+         * @param file name where exception occurs
+         * @param line number where the exception occurred.
+         * @param message to report
+         * @param list of primitives that are formatted into the message
+         */
+        NoSuchElementException( const char* file, 
+                                const int lineNumber,
+                                const char* msg, ... )
+        {
+            va_list vargs;
+            va_start( vargs, msg );
+            buildMessage( msg, vargs );
             
-         // Set the first mark for this exception.
-         setMark(file, lineNumber);
-      }
-
-      /**
-       * Clones this exception.  This is useful for cases where you need
-       * to preserve the type of the original exception as well as the message.
-       * All subclasses should override.
-       */
-      virtual ActiveMQException* clone(void) const{
-         return new NoSuchElementException(*this);
-      }
-
-      /**
-       * Destructor
-       */
-      virtual ~NoSuchElementException(void) {}
+            // Set the first mark for this exception.
+            setMark( file, lineNumber );
+        }
+
+        /**
+         * Clones this exception.  This is useful for cases where you need
+         * to preserve the type of the original exception as well as the message.
+         * All subclasses should override.
+         */
+        virtual ActiveMQException* clone(void) const{
+            return new NoSuchElementException(*this);
+        }
 
-   };
+        virtual ~NoSuchElementException(void) {}
+
+    };
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/NullPointerException.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/NullPointerException.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/NullPointerException.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/NullPointerException.h Fri Jul 21 04:36:09 2006
@@ -22,69 +22,66 @@
 namespace activemq{
 namespace exceptions{
 
-   /*
-    * Thrown when an error occurs that involves a pointer being NULL
-    */
-   class NullPointerException : public ActiveMQException
-   {
-   public:
-
-      /**
-       * Default Constructor
-       */
-      NullPointerException(void) {};
-
-      /**
-       * Conversion Constructor from some other ActiveMQException
-       * @param An exception that should become this type of Exception
-       */
-      NullPointerException(const ActiveMQException& ex){
-         *(ActiveMQException*)this = ex;
-      }
-
-      /**
-       * Copy Constructor
-       */
-      NullPointerException(const NullPointerException& ex){
-         *(ActiveMQException*)this = ex;
-      }
-
-      /**
-       * Constructor - Initializes the file name and line number where
-       * this message occured.  Sets the message to report, using an 
-       * optional list of arguments to parse into the message
-       * @param file name where exception occurs
-       * @param line number where the exception occurred.
-       * @param message to report
-       * @param list of primitives that are formatted into the message
-       */
-      NullPointerException(const char* file, 
-                           const int lineNumber,
-                           const char* msg, ...)
-      {
-         va_list vargs;
-         va_start(vargs, msg);
-         buildMessage(msg, vargs);
+    /*
+     * Thrown when an error occurs that involves a pointer being NULL
+     */
+    class NullPointerException : public ActiveMQException
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        NullPointerException(void) {};
+
+        /**
+         * Conversion Constructor from some other ActiveMQException
+         * @param An exception that should become this type of Exception
+         */
+        NullPointerException( const ActiveMQException& ex ){
+            *(ActiveMQException*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        NullPointerException(const NullPointerException& ex){
+            *(ActiveMQException*)this = ex;
+        }
+
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occured.  Sets the message to report, using an 
+         * optional list of arguments to parse into the message
+         * @param file name where exception occurs
+         * @param line number where the exception occurred.
+         * @param message to report
+         * @param list of primitives that are formatted into the message
+         */
+        NullPointerException( const char* file, 
+                              const int lineNumber,
+                              const char* msg, ... )
+        {
+            va_list vargs;
+            va_start( vargs, msg );
+            buildMessage( msg, vargs );
             
-         // Set the first mark for this exception.
-         setMark(file, lineNumber);
-      }
-
-      /**
-       * Clones this exception.  This is useful for cases where you need
-       * to preserve the type of the original exception as well as the message.
-       * All subclasses should override.
-       */
-      virtual ActiveMQException* clone(void) const{
-         return new NullPointerException(*this);
-      }
-
-      /**
-       * Destructor
-       */
-      virtual ~NullPointerException(void) {}
+            // Set the first mark for this exception.
+            setMark( file, lineNumber );
+        }
+
+        /**
+         * Clones this exception.  This is useful for cases where you need
+         * to preserve the type of the original exception as well as the message.
+         * All subclasses should override.
+         */
+        virtual ActiveMQException* clone(void) const{
+            return new NullPointerException( *this );
+        }
 
-   };
+        virtual ~NullPointerException(void) {}
+
+    };
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/RuntimeException.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/RuntimeException.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/RuntimeException.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/RuntimeException.h Fri Jul 21 04:36:09 2006
@@ -22,71 +22,68 @@
 namespace activemq{
 namespace exceptions{
 
-   /*
-    * Thrown when an error occurs that involves something in the run time
-    * This could be a memory allocation exception or some other generally
-    * unrecoverable exception.
-    */
-   class RuntimeException : public ActiveMQException
-   {
-   public:
-
-      /**
-       * Default Constructor
-       */
-      RuntimeException(void) {};
-
-      /**
-       * Conversion Constructor from some other ActiveMQException
-       * @param An exception that should become this type of Exception
-       */
-      RuntimeException(const ActiveMQException& ex){
-         *(ActiveMQException*)this = ex;
-      }
-
-      /**
-       * Copy Constructor
-       */
-      RuntimeException(const RuntimeException& ex){
-         *(ActiveMQException*)this = ex;
-      }
-
-      /**
-       * Constructor - Initializes the file name and line number where
-       * this message occured.  Sets the message to report, using an 
-       * optional list of arguments to parse into the message
-       * @param file name where exception occurs
-       * @param line number where the exception occurred.
-       * @param message to report
-       * @param list of primitives that are formatted into the message
-       */
-      RuntimeException(const char* file, 
-                       const int lineNumber,
-                       const char* msg, ...)
-      {
-         va_list vargs;
-         va_start(vargs, msg);
-         buildMessage(msg, vargs);
+    /*
+     * Thrown when an error occurs that involves something in the run time
+     * This could be a memory allocation exception or some other generally
+     * unrecoverable exception.
+     */
+    class RuntimeException : public ActiveMQException
+    {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        RuntimeException(void) {};
+
+        /**
+         * Conversion Constructor from some other ActiveMQException
+         * @param An exception that should become this type of Exception
+         */
+        RuntimeException( const ActiveMQException& ex ){
+            *(ActiveMQException*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         */
+        RuntimeException( const RuntimeException& ex ){
+            *(ActiveMQException*)this = ex;
+        }
+
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occured.  Sets the message to report, using an 
+         * optional list of arguments to parse into the message
+         * @param file name where exception occurs
+         * @param line number where the exception occurred.
+         * @param message to report
+         * @param list of primitives that are formatted into the message
+         */
+        RuntimeException( const char* file, 
+                          const int lineNumber,
+                          const char* msg, ... )
+        {
+            va_list vargs;
+            va_start(vargs, msg);
+            buildMessage(msg, vargs);
             
-         // Set the first mark for this exception.
-         setMark(file, lineNumber);
-      }
-
-      /**
-       * Clones this exception.  This is useful for cases where you need
-       * to preserve the type of the original exception as well as the message.
-       * All subclasses should override.
-       */
-      virtual ActiveMQException* clone(void) const{
-         return new RuntimeException(*this);
-      }
-
-      /**
-       * Destructor
-       */
-      virtual ~RuntimeException(void) {}
+            // Set the first mark for this exception.
+            setMark(file, lineNumber);
+        }
+
+        /**
+         * Clones this exception.  This is useful for cases where you need
+         * to preserve the type of the original exception as well as the message.
+         * All subclasses should override.
+         */
+        virtual ActiveMQException* clone(void) const{
+            return new RuntimeException( *this );
+        }
 
-   };
+        virtual ~RuntimeException(void) {}
+
+    };
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/UnsupportedOperationException.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/UnsupportedOperationException.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/UnsupportedOperationException.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/exceptions/UnsupportedOperationException.h Fri Jul 21 04:36:09 2006
@@ -22,68 +22,66 @@
 namespace activemq{
 namespace exceptions{
 
-   /*
-    * Thrown when an unsupported method is called.
-    */
-   class UnsupportedOperationException : public ActiveMQException
-   {
-   public:
+    /*
+     * Thrown when an unsupported method is called.
+     */
+    class UnsupportedOperationException : public ActiveMQException
+    {
+    public:
    
-      /**
-       * Default Constructor
-       */
-      UnsupportedOperationException(void) {};
+        /**
+         * Default Constructor
+         */
+        UnsupportedOperationException(void) {};
       
-      /**
-       * Conversion Constructor from some other ActiveMQException
-       * @param An exception that should become this type of Exception
-       */
-      UnsupportedOperationException( const ActiveMQException& ex ){
-         *(ActiveMQException*)this = ex;
-      }
+        /**
+         * Conversion Constructor from some other ActiveMQException
+         * @param An exception that should become this type of Exception
+         */
+        UnsupportedOperationException( const ActiveMQException& ex ){
+            *(ActiveMQException*)this = ex;
+        }
 
-      /**
-       * Copy Constructor
-       */
-      UnsupportedOperationException( const UnsupportedOperationException& ex ){
-         *(ActiveMQException*)this = ex;
-      }
+        /**
+         * Copy Constructor
+         */
+        UnsupportedOperationException( const UnsupportedOperationException& ex ){
+            *(ActiveMQException*)this = ex;
+        }
 
-      /**
-       * Constructor - Initializes the file name and line number where
-       * this message occured.  Sets the message to report, using an 
-       * optional list of arguments to parse into the message
-       * @param file name where exception occurs
-       * @param line number where the exception occurred.
-       * @param message to report
-       * @param list of primitives that are formatted into the message
-       */
-      UnsupportedOperationException(const char* file, const int lineNumber,
-         const char* msg, ...)
-      {
-         va_list vargs ;
-         va_start(vargs, msg) ;
-         buildMessage(msg, vargs) ;
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occured.  Sets the message to report, using an 
+         * optional list of arguments to parse into the message
+         * @param file name where exception occurs
+         * @param line number where the exception occurred.
+         * @param message to report
+         * @param list of primitives that are formatted into the message
+         */
+        UnsupportedOperationException( const char* file, 
+                                       const int lineNumber,
+                                       const char* msg, ... )
+        {
+            va_list vargs;
+            va_start( vargs, msg );
+            buildMessage( msg, vargs );
             
-         // Set the first mark for this exception.
-         setMark( file, lineNumber );
-      }
+            // Set the first mark for this exception.
+            setMark( file, lineNumber );
+        }
         
-      /**
-       * Clones this exception.  This is useful for cases where you need
-       * to preserve the type of the original exception as well as the message.
-       * All subclasses should override.
-       */
-      virtual ActiveMQException* clone() const{
-         return new UnsupportedOperationException( *this );
-      }
+        /**
+         * Clones this exception.  This is useful for cases where you need
+         * to preserve the type of the original exception as well as the message.
+         * All subclasses should override.
+         */
+        virtual ActiveMQException* clone() const{
+            return new UnsupportedOperationException( *this );
+        }
 
-      /**
-       * Destructor
-       */
-      virtual ~UnsupportedOperationException(){}
+        virtual ~UnsupportedOperationException(){}
         
-   };
+    };
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedInputStream.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedInputStream.cpp?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedInputStream.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedInputStream.cpp Fri Jul 21 04:36:09 2006
@@ -24,15 +24,15 @@
 ////////////////////////////////////////////////////////////////////////////////
 BufferedInputStream::BufferedInputStream( InputStream* stream )
 {
-	// Default to a 1k buffer.
-	init( stream, 1024 );
+    // Default to a 1k buffer.
+    init( stream, 1024 );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 BufferedInputStream::BufferedInputStream( InputStream* stream, 
-	const int bufferSize )
+    const int bufferSize )
 {
-	init( stream, bufferSize );
+    init( stream, bufferSize );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -47,99 +47,99 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void BufferedInputStream::init( InputStream* stream, const int bufferSize ){
-	
-	this->stream = stream;
-	this->bufferSize = bufferSize;
-	
-	// Create the buffer and initialize the head and tail positions.
-	buffer = new unsigned char[bufferSize];
-	head = 0;
-	tail = 0;
+    
+    this->stream = stream;
+    this->bufferSize = bufferSize;
+    
+    // Create the buffer and initialize the head and tail positions.
+    buffer = new unsigned char[bufferSize];
+    head = 0;
+    tail = 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void BufferedInputStream::close() throw(cms::CMSException){
-	
-	// Close the delegate stream.
-	stream->close();
+void BufferedInputStream::close() throw( cms::CMSException ){
+    
+    // Close the delegate stream.
+    stream->close();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-unsigned char BufferedInputStream::read() throw (IOException){
-	
-	// If we don't have any data buffered yet - read as much as we can.	
-	if( tail == head ){
-		bufferData();
-	}
-	
-	// Get the next character.
-	char returnValue = buffer[head++];
-	
-	// If the buffer is now empty - reset it to the beginning of the buffer.
-	if( tail == head ){
-		tail = head = 0;
-	}
-	
-	return returnValue;
+unsigned char BufferedInputStream::read() throw ( IOException ){
+    
+    // If we don't have any data buffered yet - read as much as we can. 
+    if( tail == head ){
+        bufferData();
+    }
+    
+    // Get the next character.
+    char returnValue = buffer[head++];
+    
+    // If the buffer is now empty - reset it to the beginning of the buffer.
+    if( tail == head ){
+        tail = head = 0;
+    }
+    
+    return returnValue;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 int BufferedInputStream::read( unsigned char* buffer, 
-	const int bufferSize ) throw (IOException){
-	
-	// 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.
-	int totalRead = 0;
-	while( totalRead < bufferSize ){		
-		
-		// Get the remaining bytes to copy.
-		int bytesToCopy = min( tail-head, (bufferSize-totalRead) );
-		
-		// Copy the data to the output buffer.	
-		memcpy( buffer+totalRead, this->buffer+head, bytesToCopy );
-		
-		// Increment the total bytes read.
-		totalRead += bytesToCopy;
-		
-		// Increment the head position.  If the buffer is now empty,
-		// reset the positions and buffer more data.
-		head += bytesToCopy;
-		if( head == tail ){
-			
-			// Reset the buffer indicies.
-			head = tail = 0;
-			
-			// If there is no more data currently available on the 
-			// input stream, stop the loop.
-			if( stream->available() == 0 ){
-				break;
-			}
-			
-			// Buffer as much data as we can.
-			bufferData();
-		}				
-	}
-	
-	// Return the total number of bytes read.
-	return totalRead;
+    const int bufferSize ) throw ( IOException ){
+    
+    // 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.
+    int totalRead = 0;
+    while( totalRead < bufferSize ){        
+        
+        // Get the remaining bytes to copy.
+        int bytesToCopy = min( tail-head, (bufferSize-totalRead) );
+        
+        // Copy the data to the output buffer.  
+        memcpy( buffer+totalRead, this->buffer+head, bytesToCopy );
+        
+        // Increment the total bytes read.
+        totalRead += bytesToCopy;
+        
+        // Increment the head position.  If the buffer is now empty,
+        // reset the positions and buffer more data.
+        head += bytesToCopy;
+        if( head == tail ){
+            
+            // Reset the buffer indicies.
+            head = tail = 0;
+            
+            // If there is no more data currently available on the 
+            // input stream, stop the loop.
+            if( stream->available() == 0 ){
+                break;
+            }
+            
+            // Buffer as much data as we can.
+            bufferData();
+        }               
+    }
+    
+    // Return the total number of bytes read.
+    return totalRead;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void BufferedInputStream::bufferData() throw (IOException){
-	
-	if( tail == bufferSize ){
-		throw IOException( __FILE__, __LINE__, 
+void BufferedInputStream::bufferData() throw ( IOException ){
+    
+    if( tail == bufferSize ){
+        throw IOException( __FILE__, __LINE__, 
             "BufferedInputStream::bufferData - buffer full" );
-	}
-	
-	// Read in as many bytes as we can.
-	int bytesRead = stream->read( buffer+tail, bufferSize-tail );
-	if( bytesRead == 0 ){
-		throw IOException( __FILE__, __LINE__, 
+    }
+    
+    // Read in as many bytes as we can.
+    int bytesRead = stream->read( buffer+tail, bufferSize-tail );
+    if( bytesRead == 0 ){
+        throw IOException( __FILE__, __LINE__, 
             "BufferedInputStream::read() - failed reading bytes from stream");
-	}
-	
-	// Increment the tail to the new end position.
-	tail += bytesRead;
+    }
+    
+    // Increment the tail to the new end position.
+    tail += bytesRead;
 }

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedInputStream.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedInputStream.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedInputStream.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedInputStream.h Fri Jul 21 04:36:09 2006
@@ -24,167 +24,174 @@
 namespace activemq{
 namespace io{
       
-   /**
-    * A wrapper around another input stream that performs
-    * a buffered read, where it reads more data than it needs
-    * in order to reduce the number of io operations on the
-    * input stream.
-    */
-   class BufferedInputStream : public InputStream
-   {
-   private:
+    /**
+     * A wrapper around another input stream that performs
+     * a buffered read, where it reads more data than it needs
+     * in order to reduce the number of io operations on the
+     * input stream.
+     */
+    class BufferedInputStream : public InputStream
+    {
+    private:
    
-      /**
-       * The target input stream.
-       */
-      InputStream* stream;
-      
-      /**
-       * The internal buffer.
-       */
-      unsigned char* buffer;
-      
-      /**
-       * The buffer size.
-       */
-      int bufferSize;
-      
-      /**
-       * The current head of the buffer.
-       */
-      int head;
-      
-      /**
-       * The current tail of the buffer.
-       */
-      int tail;
+        /**
+         * The target input stream.
+         */
+        InputStream* stream;
+      
+        /**
+         * The internal buffer.
+         */
+        unsigned char* buffer;
+      
+        /**
+         * The buffer size.
+         */
+        int bufferSize;
+      
+        /**
+         * The current head of the buffer.
+         */
+        int head;
+      
+        /**
+         * The current tail of the buffer.
+         */
+        int tail;
       
-   public:
+    public:
    
-      /**
-       * Constructor
-       * @param stream The target input stream.
-       */
-      BufferedInputStream( InputStream* stream );
-      
-      /**
-       * Constructor
-       * @param stream the target input stream
-       * @param bufferSize the size for the internal buffer.
-       */
-      BufferedInputStream( InputStream* stream, const int bufferSize );
-      
-      /**
-       * Destructor.
-       */
-      virtual ~BufferedInputStream();
-      
-      /**
-       * Locks the object.
-       */
-      virtual void lock() throw(exceptions::ActiveMQException){
-         assert( stream != NULL );
-         stream->lock();
-      }
+        /**
+         * Constructor
+         * @param stream The target input stream.
+         */
+        BufferedInputStream( InputStream* stream );
+      
+        /**
+         * Constructor
+         * @param stream the target input stream
+         * @param bufferSize the size for the internal buffer.
+         */
+        BufferedInputStream( InputStream* stream, const int bufferSize );
+      
+        virtual ~BufferedInputStream();
+      
+        /**
+         * Locks the object.
+         * throws ActiveMQException
+         */
+        virtual void lock() throw( exceptions::ActiveMQException ){
+            assert( stream != NULL );
+            stream->lock();
+        }
    
-      /**
-       * Unlocks the object.
-       */
-      virtual void unlock() throw(exceptions::ActiveMQException){   
-         assert( stream != NULL );
-         stream->unlock();
-      }
+        /**
+         * Unlocks the object.
+         * throws ActiveMQException
+         */
+        virtual void unlock() throw( exceptions::ActiveMQException ){   
+           assert( stream != NULL );
+           stream->unlock();
+        }
        
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.
-       */
-      virtual void wait() throw(exceptions::ActiveMQException){
-         assert( stream != NULL );
-         stream->wait();
-      }
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.
+         * throws ActiveMQException
+         */
+        virtual void wait() throw( exceptions::ActiveMQException ){
+            assert( stream != NULL );
+            stream->wait();
+        }
     
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.  This wait will timeout after the specified time
-       * interval.
-       * @param time in millisecsonds to wait, or WAIT_INIFINITE
-       * @throws ActiveMQException
-       */
-      virtual void wait(unsigned long millisecs) 
-         throw(exceptions::ActiveMQException) {
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.  This wait will timeout after the specified time
+         * interval.
+         * @param time in millisecsonds to wait, or WAIT_INIFINITE
+         * @throws ActiveMQException
+         */
+        virtual void wait( unsigned long millisecs ) 
+            throw( exceptions::ActiveMQException ) {
          
-         assert( stream != NULL );
-         stream->wait(millisecs);
-      }
+            assert( stream != NULL );
+            stream->wait(millisecs);
+        }
 
-      /**
-       * Signals a waiter on this object that it can now wake
-       * up and continue.  Must have this object locked before
-       * calling.
-       */
-      virtual void notify() throw(exceptions::ActiveMQException){
-         assert( stream != NULL );
-         stream->notify();
-      }
+        /**
+         * Signals a waiter on this object that it can now wake
+         * up and continue.  Must have this object locked before
+         * calling.
+         * throws ActiveMQException
+         */
+        virtual void notify() throw( exceptions::ActiveMQException ){
+            assert( stream != NULL );
+            stream->notify();
+        }
         
-      /**
-       * Signals the waiters on this object that it can now wake
-       * up and continue.  Must have this object locked before
-       * calling.
-       */
-      virtual void notifyAll() throw(exceptions::ActiveMQException){
-         assert( stream != NULL );
-         stream->notifyAll();
-      }
+        /**
+         * Signals the waiters on this object that it can now wake
+         * up and continue.  Must have this object locked before
+         * calling.
+         * throws ActiveMQException
+         */
+        virtual void notifyAll() throw( exceptions::ActiveMQException ){
+            assert( stream != NULL );
+            stream->notifyAll();
+        }
     
-      /**
-       * Indcates the number of bytes avaialable.
-       * @return the sum of the amount of data avalable
-       * in the buffer and the data available on the target
-       * input stream.
-       */
-      virtual int available() const{   
-         return (tail-head)+stream->available();
-      }
+        /**
+         * Indcates the number of bytes avaialable.
+         * @return the sum of the amount of data avalable
+         * in the buffer and the data available on the target
+         * input stream.
+         */
+        virtual int available() const{   
+            return ( tail - head ) + stream->available();
+        }
             
-      /**
-       * Reads a single byte from the buffer.
-       * @return The next byte.
-       * @throws IOException thrown if an error occurs.
-       */
-      virtual unsigned char read() throw (IOException);
-      
-      /**
-       * Reads an array of bytes from the buffer.
-       * @param buffer (out) the target buffer.
-       * @param bufferSize the size of the output buffer.
-       * @return The number of bytes read.
-       * @throws IOException thrown if an error occurs.
-       */
-      virtual int read( unsigned char* buffer, const int bufferSize ) throw (IOException);
-      
-      /**
-       * Closes the target input stream.
-       */
-      virtual void close(void) throw(cms::CMSException);
+        /**
+         * Reads a single byte from the buffer.
+         * @return The next byte.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual unsigned char read() throw ( IOException );
+      
+        /**
+         * Reads an array of bytes from the buffer.
+         * @param buffer (out) the target buffer.
+         * @param bufferSize the size of the output buffer.
+         * @return The number of bytes read.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual int read( unsigned char* buffer, const int bufferSize ) 
+            throw ( IOException );
+      
+        /**
+         * Closes the target input stream.
+         * @throws CMSException
+         */
+        virtual void close(void) throw( cms::CMSException );
       
-   private:
+    private:
    
-      /**
-       * Initializes the internal structures.
-       */
-      void init( InputStream* stream, const int bufferSize );
-      
-      /**
-       * Populates the buffer with as much data as possible
-       * from the target input stream.
-       */
-      void bufferData(void) throw (IOException);
+        /**
+         * Initializes the internal structures.
+         * @param stream to read from
+         * @param size of buffer to allocate
+         */
+        void init( InputStream* stream, const int bufferSize );
+      
+        /**
+         * Populates the buffer with as much data as possible
+         * from the target input stream.
+         * @throws CMSException
+         */
+        void bufferData(void) throw ( IOException );
 
-   };
+    };
    
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.cpp?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.cpp Fri Jul 21 04:36:09 2006
@@ -24,15 +24,15 @@
 ////////////////////////////////////////////////////////////////////////////////
 BufferedOutputStream::BufferedOutputStream( OutputStream* stream )
 {
-	// Default to 1k buffer.
-	init( stream, 1024 );
+    // Default to 1k buffer.
+    init( stream, 1024 );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 BufferedOutputStream::BufferedOutputStream( OutputStream* stream, 
-	const int bufSize )
+    const int bufSize )
 {
-	init( stream, bufSize );
+    init( stream, bufSize );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -47,75 +47,74 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 void BufferedOutputStream::init( OutputStream* stream, const int bufSize ){
-	
-	this->stream = stream;
-	this->bufferSize = bufSize;
-	
-	buffer = new unsigned char[bufSize];
-	head = tail = 0;
+    
+    this->stream = stream;
+    this->bufferSize = bufSize;
+    
+    buffer = new unsigned char[bufSize];
+    head = tail = 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void BufferedOutputStream::close() throw(cms::CMSException){
-	
-	// Flush this stream.
-	flush();	
-	
-	// Close the delegate stream.
-	stream->close();
+void BufferedOutputStream::close() throw( cms::CMSException ){
+    
+    // Flush this stream.
+    flush();    
+    
+    // Close the delegate stream.
+    stream->close();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void BufferedOutputStream::emptyBuffer() throw (IOException){
-	
-	if( head != tail ){
-		stream->write( buffer+head, tail-head );
-	}
-	head = tail = 0;
+void BufferedOutputStream::emptyBuffer() throw ( IOException ){
+    
+    if( head != tail ){
+        stream->write( buffer+head, tail-head );
+    }
+    head = tail = 0;
 }
-		
+        
 ////////////////////////////////////////////////////////////////////////////////
-void BufferedOutputStream::flush() throw (IOException){
-	
-	// Empty the contents of the buffer to the output stream.
-	emptyBuffer();
-	
-	// Flush the output stream.
-	stream->flush();
+void BufferedOutputStream::flush() throw ( IOException ){
+    
+    // Empty the contents of the buffer to the output stream.
+    emptyBuffer();
+    
+    // Flush the output stream.
+    stream->flush();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void BufferedOutputStream::write( const unsigned char c ) throw (IOException){
-	
-	if( tail >= bufferSize ){
-		emptyBuffer();
-	}
-	
-	buffer[tail++] = c;	
+void BufferedOutputStream::write( const unsigned char c ) throw ( IOException ){
+    
+    if( tail >= bufferSize ){
+        emptyBuffer();
+    }
+    
+    buffer[tail++] = c; 
 }
 
-////////////////////////////////////////////////////////////////////////////////		
+////////////////////////////////////////////////////////////////////////////////        
 void BufferedOutputStream::write( const unsigned char* buffer, const int len ) 
-	throw (IOException)
-{		
-	// Iterate until all the data is written.
-	for( int pos=0; pos < len; ){
-		
-		if( tail >= bufferSize ){
-			emptyBuffer();
-		}
-	
-		// Get the number of bytes left to write.
-		int bytesToWrite = min( bufferSize-tail, len-pos );
-		
-		// Copy the data.
-		memcpy( this->buffer+tail, buffer+pos, bytesToWrite );
-		
-		// Increase the tail position.
-		tail += bytesToWrite;
-		
-		// Decrease the number of bytes to write.
-		pos += bytesToWrite;	
-	}	
+    throw ( IOException )
+{       
+    // Iterate until all the data is written.
+    for( int pos=0; pos < len; ){
+        
+        if( tail >= bufferSize ){
+            emptyBuffer();
+        }
+    
+        // Get the number of bytes left to write.
+        int bytesToWrite = min( bufferSize-tail, len-pos );
+        
+        // Copy the data.
+        memcpy( this->buffer+tail, buffer+pos, bytesToWrite );
+        
+        // Increase the tail position.
+        tail += bytesToWrite;
+        
+        // Decrease the number of bytes to write.
+        pos += bytesToWrite;    
+    }   
 }
-

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/BufferedOutputStream.h Fri Jul 21 04:36:09 2006
@@ -24,156 +24,161 @@
 namespace activemq{
 namespace io{
    
-   /**
-    * Wrapper around another output stream that buffers
-    * output before writing to the target output stream.
-    */
-   class BufferedOutputStream : public OutputStream
-   {
-   private:
+    /**
+     * Wrapper around another output stream that buffers
+     * output before writing to the target output stream.
+     */
+    class BufferedOutputStream : public OutputStream
+    {
+    private:
    
-      /**
-       * The target output stream.
-       */
-      OutputStream* stream;
-      
-      /**
-       * The internal buffer.
-       */
-      unsigned char* buffer;
-      
-      /**
-       * The size of the internal buffer.
-       */
-      int bufferSize;
-      
-      /**
-       * The current head of the buffer.
-       */
-      int head;
-      
-      /**
-       * The current tail of the buffer.
-       */
-      int tail;
+        /**
+         * The target output stream.
+         */
+        OutputStream* stream;
+      
+        /**
+         * The internal buffer.
+         */
+        unsigned char* buffer;
+      
+        /**
+         * The size of the internal buffer.
+         */
+        int bufferSize;
+      
+        /**
+         * The current head of the buffer.
+         */
+        int head;
+      
+        /**
+         * The current tail of the buffer.
+         */
+        int tail;
       
-   public:
+    public:
    
-      /**
-       * Constructor.
-       * @param stream the target output stream.
-       */
-      BufferedOutputStream( OutputStream* stream );
-      
-      /**
-       * Constructor
-       * @param stream the target output stream.
-       * @param bufSize the size for the internal buffer.
-       */
-      BufferedOutputStream( OutputStream* stream, const int bufSize );
-      
-      /**
-       * Destructor
-       */
-      virtual ~BufferedOutputStream();
-      
-      /**
-       * Locks the object.
-       */
-      virtual void lock() throw(exceptions::ActiveMQException){
-         assert( stream != NULL );
-         stream->lock();
-      }
+        /**
+         * Constructor.
+         * @param stream the target output stream.
+         */
+        BufferedOutputStream( OutputStream* stream );
+      
+        /**
+         * Constructor
+         * @param stream the target output stream.
+         * @param bufSize the size for the internal buffer.
+         */
+        BufferedOutputStream( OutputStream* stream, const int bufSize );
+      
+        virtual ~BufferedOutputStream();
+      
+        /**
+         * Locks the object.
+         * @throws ActiveMQException
+         */
+        virtual void lock() throw( exceptions::ActiveMQException ){
+            assert( stream != NULL );
+            stream->lock();
+        }
    
-      /**
-       * Unlocks the object.
-       */
-      virtual void unlock() throw(exceptions::ActiveMQException){   
-         assert( stream != NULL );
-         stream->unlock();
-      }
+        /**
+         * Unlocks the object.
+         * @throws ActiveMQException
+         */
+        virtual void unlock() throw( exceptions::ActiveMQException ){   
+            assert( stream != NULL );
+            stream->unlock();
+        }
        
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.
-       */
-      virtual void wait() throw(exceptions::ActiveMQException){
-         assert( stream != NULL );
-         stream->wait();
-      }
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void wait() throw( exceptions::ActiveMQException ){
+            assert( stream != NULL );
+            stream->wait();
+        }
     
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.  This wait will timeout after the specified time
-       * interval.
-       * @param time in millisecsonds to wait, or WAIT_INIFINITE
-       * @throws ActiveMQException
-       */
-      virtual void wait(unsigned long millisecs) 
-         throw(exceptions::ActiveMQException) {
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.  This wait will timeout after the specified time
+         * interval.
+         * @param time in millisecsonds to wait, or WAIT_INIFINITE
+         * @throws ActiveMQException
+         */
+        virtual void wait( unsigned long millisecs ) 
+            throw( exceptions::ActiveMQException ) {
          
-         assert( stream != NULL );
-         stream->wait(millisecs);
-      }
+            assert( stream != NULL );
+            stream->wait( millisecs );
+        }
 
-      /**
-       * Signals a waiter on this object that it can now wake
-       * up and continue.  Must have this object locked before
-       * calling.
-       */
-      virtual void notify() throw(exceptions::ActiveMQException){
-         assert( stream != NULL );
-         stream->notify();
-      }
+        /**
+         * Signals a waiter on this object that it can now wake
+         * up and continue.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void notify() throw( exceptions::ActiveMQException ){
+            assert( stream != NULL );
+            stream->notify();
+        }
         
-      /**
-       * Signals the waiters on this object that it can now wake
-       * up and continue.  Must have this object locked before
-       * calling.
-       */
-      virtual void notifyAll() throw(exceptions::ActiveMQException){
-         assert( stream != NULL );
-         stream->notifyAll();
-      }
+        /**
+         * Signals the waiters on this object that it can now wake
+         * up and continue.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void notifyAll() throw( exceptions::ActiveMQException ){
+            assert( stream != NULL );
+            stream->notifyAll();
+        }
        
-       /**
-       * Writes a single byte to the output stream.
-       * @param c the byte.
-       * @throws IOException thrown if an error occurs.
-       */
-      virtual void write( const unsigned char c ) throw (IOException);
-      
-      /**
-       * Writes an array of bytes to the output stream.
-       * @param buffer The array of bytes to write.
-       * @param len The number of bytes from the buffer to be written.
-       * @throws IOException thrown if an error occurs.
-       */
-      virtual void write( const unsigned char* buffer, const int len ) throw (IOException);
-      
-      /**
-       * Invokes flush on the target output stream.
-       */
-      virtual void flush() throw (IOException);
-      
-      /**
-       * Invokes close on the target output stream.
-       */
-      void close() throw(cms::CMSException);
+        /**
+         * Writes a single byte to the output stream.
+         * @param c the byte.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual void write( const unsigned char c ) throw ( IOException );
+      
+        /**
+         * Writes an array of bytes to the output stream.
+         * @param buffer The array of bytes to write.
+         * @param len The number of bytes from the buffer to be written.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual void write( const unsigned char* buffer, const int len ) throw ( IOException );
+      
+        /**
+         * Invokes flush on the target output stream.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual void flush() throw ( IOException );
+      
+        /**
+         * Invokes close on the target output stream.
+         * @throws CMSException thrown if an error occurs.
+         */
+        void close() throw( cms::CMSException );
       
    private:
    
-      /**
-       * Initializes the internal structures.
-       */
-      void init( OutputStream* stream, const int bufSize );
-      
-      /**
-       * Writes the contents of the buffer to the output stream.
-       */
-      void emptyBuffer() throw (IOException);
+        /**
+         * Initializes the internal structures.
+         */
+        void init( OutputStream* stream, const int bufSize );
+      
+        /**
+         * Writes the contents of the buffer to the output stream.
+         */
+        void emptyBuffer() throw ( IOException );
+
    };
 
 }}

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayInputStream.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayInputStream.cpp?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayInputStream.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayInputStream.cpp Fri Jul 21 04:36:09 2006
@@ -24,14 +24,14 @@
 ////////////////////////////////////////////////////////////////////////////////
 ByteArrayInputStream::ByteArrayInputStream()
 {
-   pos = buffer.end();
+    pos = buffer.end();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 ByteArrayInputStream::ByteArrayInputStream( const unsigned char* buffer,
                                             int bufferSize )
 {
-   setByteArray( buffer, bufferSize );
+    setByteArray( buffer, bufferSize );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -43,54 +43,54 @@
 void ByteArrayInputStream::setByteArray( const unsigned char* buffer,
                                          int bufferSize )
 {
-   // Remove old data
-   this->buffer.clear();
+    // Remove old data
+    this->buffer.clear();
    
-   // Copy data to internal buffer.
-   for( int ix = 0; ix < bufferSize; ++ix )
-   {
-      this->buffer.push_back(buffer[ix]);
-   }
+    // Copy data to internal buffer.
+    for( int ix = 0; ix < bufferSize; ++ix )
+    {
+        this->buffer.push_back(buffer[ix]);
+    }
    
-   // Begin at the Beginning.
-   pos = this->buffer.begin();
+    // Begin at the Beginning.
+    pos = this->buffer.begin();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayInputStream::close() throw(cms::CMSException){
-	
-	// Close the delegate stream.
-	buffer.clear();
+void ByteArrayInputStream::close() throw( cms::CMSException ){
+    
+    // Close the delegate stream.
+    buffer.clear();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-unsigned char ByteArrayInputStream::read() throw (IOException)
+unsigned char ByteArrayInputStream::read() throw ( IOException )
 {
-   if(pos != buffer.end())
-   {
-      return *(pos++);
-   }
+    if(pos != buffer.end())
+    {
+        return *(pos++);
+    }
    
-   throw IOException( __FILE__, __LINE__, 
-      "ByteArrayInputStream::read: Out of Data");
+    throw IOException( __FILE__, __LINE__, 
+        "ByteArrayInputStream::read: Out of Data");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 int ByteArrayInputStream::read( unsigned char* buffer, 
-	                             const int bufferSize ) 
-                                   throw (IOException)
+                                const int bufferSize ) 
+                                   throw ( IOException )
 {
-   int ix = 0;
+     int ix = 0;
    
-   for( ; ix < bufferSize; ++ix, ++pos)
-   {
-      if(pos == this->buffer.end())
-      {        
-         break;
-      }
+     for( ; ix < bufferSize; ++ix, ++pos)
+     {
+        if(pos == this->buffer.end())
+        {        
+            break;
+        }
       
-      buffer[ix] = *(pos);
-   }
+        buffer[ix] = *(pos);
+    }
    
-   return ix;
+    return ix;
 }

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayInputStream.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayInputStream.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayInputStream.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayInputStream.h Fri Jul 21 04:36:09 2006
@@ -26,147 +26,145 @@
 namespace activemq{
 namespace io{
 
-   class ByteArrayInputStream : public InputStream
-   {
-   private:
-      
-      /** 
-       * The Array of Bytes to read from.
-       */
-      std::vector<unsigned char> buffer;
-      
-      /**
-       * iterator to current position in buffer.
-       */
-      std::vector<unsigned char>::const_iterator pos;
-
-      /**
-       * Synchronization object.
-       */
-      concurrent::Mutex mutex;
+    class ByteArrayInputStream : public InputStream
+    {
+    private:
+      
+        /** 
+         * The Array of Bytes to read from.
+         */
+        std::vector<unsigned char> buffer;
+      
+        /**
+         * iterator to current position in buffer.
+         */
+        std::vector<unsigned char>::const_iterator pos;
+
+        /**
+         * Synchronization object.
+         */
+        concurrent::Mutex mutex;
       
-   public:
+    public:
    
-      /**
-       * Constructor
-       */
-      ByteArrayInputStream(void);
-      
-      /**
-       * Constructor
-       * @param initial byte array to use to read from
-       * @param the size of the buffer
-       */
-      ByteArrayInputStream( const unsigned char* buffer,
-                            int bufferSize );
-
-      /**
-       * Destructor
-       */
-   	  virtual ~ByteArrayInputStream(void);
-
-      /** 
-       * Sets the data that this reader uses, replaces any existing
-       * data and resets to beginning of the buffer.
-       * @param initial byte array to use to read from
-       * @param the size of the buffer
-       */
-      virtual void setByteArray( const unsigned char* buffer,
-                                 int bufferSize );
-
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.
-       * @throws ActiveMQException
-       */
-      virtual void lock() throw(exceptions::ActiveMQException){
-          mutex.lock();
-      }
+        /**
+         * Default Constructor
+         */
+        ByteArrayInputStream(void);
+      
+        /**
+         * Constructor
+         * @param initial byte array to use to read from
+         * @param the size of the buffer
+         */
+        ByteArrayInputStream( const unsigned char* buffer,
+                              int bufferSize );
+
+        virtual ~ByteArrayInputStream(void);
+
+        /** 
+         * Sets the data that this reader uses, replaces any existing
+         * data and resets to beginning of the buffer.
+         * @param initial byte array to use to read from
+         * @param the size of the buffer
+         */
+        virtual void setByteArray( const unsigned char* buffer,
+                                   int bufferSize );
+
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void lock() throw(exceptions::ActiveMQException){
+            mutex.lock();
+        }
     
-      /**
-       * Unlocks the object.
-       * @throws ActiveMQException
-       */
-      virtual void unlock() throw(exceptions::ActiveMQException){ 
-          mutex.unlock();
-      }
+        /**
+         * Unlocks the object.
+         * @throws ActiveMQException
+         */
+        virtual void unlock() throw(exceptions::ActiveMQException){ 
+            mutex.unlock();
+        }
         
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.
-       * @throws ActiveMQException
-       */
-      virtual void wait() throw(exceptions::ActiveMQException){
-          mutex.wait();
-      }
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void wait() throw(exceptions::ActiveMQException){
+            mutex.wait();
+        }
     
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.  This wait will timeout after the specified time
-       * interval.
-       * @param time in millisecsonds to wait, or WAIT_INIFINITE
-       * @throws ActiveMQException
-       */
-      virtual void wait(unsigned long millisecs) throw(exceptions::ActiveMQException){
-          mutex.wait(millisecs);
-      }
-
-      /**
-       * Signals a waiter on this object that it can now wake
-       * up and continue.  Must have this object locked before
-       * calling.
-       * @throws ActiveMQException
-       */
-      virtual void notify() throw(exceptions::ActiveMQException){
-          mutex.notify();
-      }
-        
-      /**
-       * Signals the waiters on this object that it can now wake
-       * up and continue.  Must have this object locked before
-       * calling.
-       * @throws ActiveMQException
-       */
-      virtual void notifyAll() throw(exceptions::ActiveMQException){
-          mutex.notifyAll();
-      }
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.  This wait will timeout after the specified time
+         * interval.
+         * @param time in millisecsonds to wait, or WAIT_INIFINITE
+         * @throws ActiveMQException
+         */
+        virtual void wait(unsigned long millisecs) throw(exceptions::ActiveMQException){
+            mutex.wait(millisecs);
+        }
+
+        /**
+         * Signals a waiter on this object that it can now wake
+         * up and continue.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void notify() throw(exceptions::ActiveMQException){
+            mutex.notify();
+        }
+         
+        /**
+         * Signals the waiters on this object that it can now wake
+         * up and continue.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void notifyAll() throw(exceptions::ActiveMQException){
+            mutex.notifyAll();
+        }
        
-      /**
-       * Indcates the number of bytes avaialable.
-       * @return the sum of the amount of data avalable
-       * in the buffer and the data available on the target
-       * input stream.
-       */
-      virtual int available() const{   
-         return distance(pos, buffer.end());
-      }
+        /**
+         * Indcates the number of bytes avaialable.
+         * @return the sum of the amount of data avalable
+         * in the buffer and the data available on the target
+         * input stream.
+         */
+        virtual int available() const{   
+            return distance(pos, buffer.end());
+        }
             
-      /**
-       * Reads a single byte from the buffer.
-       * @return The next byte.
-       * @throws IOException thrown if an error occurs.
-       */
-      virtual unsigned char read() throw (IOException);
-      
-      /**
-       * Reads an array of bytes from the buffer.
-       * @param buffer (out) the target buffer.
-       * @param bufferSize the size of the output buffer.
-       * @return The number of bytes read.
-       * @throws IOException thrown if an error occurs.
-       */
-      virtual int read( unsigned char* buffer, const int bufferSize ) 
-         throw (IOException);
-      
-      /**
-       * Closes the target input stream.
-       */
-      virtual void close() throw(cms::CMSException);
+        /**
+         * Reads a single byte from the buffer.
+         * @return The next byte.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual unsigned char read() throw (IOException);
+      
+        /**
+         * Reads an array of bytes from the buffer.
+         * @param buffer (out) the target buffer.
+         * @param bufferSize the size of the output buffer.
+         * @return The number of bytes read.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual int read( unsigned char* buffer, const int bufferSize ) 
+            throw (IOException);
+      
+        /**
+         * Closes the target input stream.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual void close() throw(cms::CMSException);
 
-   };
+    };
 
 }}
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.cpp?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.cpp Fri Jul 21 04:36:09 2006
@@ -22,41 +22,39 @@
 using namespace std;
 
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayOutputStream::close() throw(cms::CMSException)
+void ByteArrayOutputStream::close() throw( cms::CMSException )
 {  
-   // Clear the Buffer
-   flush();
+    // Clear the Buffer
+    flush();
 }
       
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayOutputStream::flush() throw (IOException)
-{
-    // No Op
-}
+void ByteArrayOutputStream::flush() throw ( IOException )
+{}
 
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayOutputStream::clear() throw (IOException)
+void ByteArrayOutputStream::clear() throw ( IOException )
 {
-   // Empty the contents of the buffer to the output stream.
-   buffer.clear();
+    // Empty the contents of the buffer to the output stream.
+    buffer.clear();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void ByteArrayOutputStream::write( const unsigned char c ) 
-   throw (IOException)
+   throw ( IOException )
 {
-   buffer.push_back( c );  
+    buffer.push_back( c );  
 }
 
 ////////////////////////////////////////////////////////////////////////////////    
 void ByteArrayOutputStream::write( const unsigned char* buffer, 
                                    const int len ) 
-   throw (IOException)
+   throw ( IOException )
 {     
-   // Iterate until all the data is written.
-   for( int ix = 0; ix < len; ++ix)
-   {
-      this->buffer.push_back( buffer[ix] );
-   }  
+    // Iterate until all the data is written.
+    for( int ix = 0; ix < len; ++ix)
+    {
+        this->buffer.push_back( buffer[ix] );
+    }  
 }
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.h Fri Jul 21 04:36:09 2006
@@ -25,143 +25,142 @@
 namespace activemq{
 namespace io{
 
-   class ByteArrayOutputStream : public OutputStream
-   {
-   private:
+    class ByteArrayOutputStream : public OutputStream
+    {
+    private:
          
-      /** 
-       * The Array of Bytes to read from.
-       */
-      std::vector<unsigned char> buffer;
-
-      /**
-       * Synchronization object.
-       */
-      concurrent::Mutex mutex;
-      
-   public:
-
-      /**
-       * Constructor
-       */
-      ByteArrayOutputStream(void) {};
-
-      /**
-       * Destructor
-       */
-   	  virtual ~ByteArrayOutputStream(void) {};
-      
-      /**
-       * Get a snapshot of the data
-       * @return pointer to the data
-       */
-      virtual const unsigned char* getByteArray(void) const
-      {
-         return &buffer[0];
-      }
-      
-      /**
-       * Get the Size of the Internal Buffer
-       */
-      virtual int getByteArraySize(void) const
-      {
-         return buffer.size();
-      }
-
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.
-       * @throws ActiveMQException
-       */
-      virtual void lock() throw(exceptions::ActiveMQException){
-          mutex.lock();
-      }
+        /** 
+         * The Array of Bytes to read from.
+         */
+        std::vector<unsigned char> buffer;
+
+        /**
+         * Synchronization object.
+         */
+        concurrent::Mutex mutex;
+      
+    public:
+
+        /**
+         * Default Constructor
+         */
+        ByteArrayOutputStream(void) {};
+
+        /**
+         * Destructor
+         */
+   	    virtual ~ByteArrayOutputStream(void) {};
+      
+        /**
+         * Get a snapshot of the data
+         * @return pointer to the data
+         */
+        virtual const unsigned char* getByteArray(void) const {
+            return &buffer[0];
+        }
+      
+        /**
+         * Get the Size of the Internal Buffer
+         * @return size of the internal buffer
+         */
+        virtual int getByteArraySize(void) const {
+            return buffer.size();
+        }
+
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void lock() throw( exceptions::ActiveMQException ){
+            mutex.lock();
+        }
     
-      /**
-       * Unlocks the object.
-       * @throws ActiveMQException
-       */
-      virtual void unlock() throw(exceptions::ActiveMQException){ 
-          mutex.unlock();
-      }
+        /**
+         * Unlocks the object.
+         * @throws ActiveMQException
+         */
+        virtual void unlock() throw( exceptions::ActiveMQException ){ 
+            mutex.unlock();
+        }
         
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.
-       * @throws ActiveMQException
-       */
-      virtual void wait() throw(exceptions::ActiveMQException){
-          mutex.wait();
-      }
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void wait() throw( exceptions::ActiveMQException ){
+            mutex.wait();
+        }
     
-      /**
-       * Waits on a signal from this object, which is generated
-       * by a call to Notify.  Must have this object locked before
-       * calling.  This wait will timeout after the specified time
-       * interval.
-       * @param time in millisecsonds to wait, or WAIT_INIFINITE
-       * @throws ActiveMQException
-       */
-      virtual void wait(unsigned long millisecs) throw(exceptions::ActiveMQException){
-          mutex.wait(millisecs);
-      }
-
-      /**
-       * Signals a waiter on this object that it can now wake
-       * up and continue.  Must have this object locked before
-       * calling.
-       * @throws ActiveMQException
-       */
-      virtual void notify() throw(exceptions::ActiveMQException){
-          mutex.notify();
-      }
+        /**
+         * Waits on a signal from this object, which is generated
+         * by a call to Notify.  Must have this object locked before
+         * calling.  This wait will timeout after the specified time
+         * interval.
+         * @param time in millisecsonds to wait, or WAIT_INIFINITE
+         * @throws ActiveMQException
+         */
+        virtual void wait( unsigned long millisecs ) throw( exceptions::ActiveMQException ){
+            mutex.wait(millisecs);
+        }
+
+        /**
+         * Signals a waiter on this object that it can now wake
+         * up and continue.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void notify() throw( exceptions::ActiveMQException ){
+            mutex.notify();
+        }
         
-      /**
-       * Signals the waiters on this object that it can now wake
-       * up and continue.  Must have this object locked before
-       * calling.
-       * @throws ActiveMQException
-       */
-      virtual void notifyAll() throw(exceptions::ActiveMQException){
-          mutex.notifyAll();
-      }
+        /**
+         * Signals the waiters on this object that it can now wake
+         * up and continue.  Must have this object locked before
+         * calling.
+         * @throws ActiveMQException
+         */
+        virtual void notifyAll() throw( exceptions::ActiveMQException ){
+            mutex.notifyAll();
+        }
        
-      /**
-       * Writes a single byte to the output stream.
-       * @param c the byte.
-       * @throws IOException thrown if an error occurs.
-       */
-      virtual void write( const unsigned char c ) 
-         throw (IOException);
-      
-      /**
-       * Writes an array of bytes to the output stream.
-       * @param buffer The array of bytes to write.
-       * @param len The number of bytes from the buffer to be written.
-       * @throws IOException thrown if an error occurs.
-       */
-      virtual void write( const unsigned char* buffer, const int len ) 
-         throw (IOException);
-      
-      /**
-       * Invokes flush on the target output stream, has no affect.
-       * @throws IOException
-       */
-      virtual void flush( void ) throw (IOException);
-      
-      /**
-       * Clear current Stream contents
-       * @throws IOException
-       */
-      virtual void clear( void ) throw (IOException);
-
-      /**
-       * Invokes close on the target output stream.
-       * @throws CMSException
-       */
-      void close( void ) throw(cms::CMSException);
+        /**
+         * Writes a single byte to the output stream.
+         * @param c the byte.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual void write( const unsigned char c ) 
+           throw ( IOException );
+      
+        /**
+         * Writes an array of bytes to the output stream.
+         * @param buffer The array of bytes to write.
+         * @param len The number of bytes from the buffer to be written.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual void write( const unsigned char* buffer, const int len ) 
+            throw ( IOException );
+      
+        /**
+         * Invokes flush on the target output stream, has no affect.
+         * @throws IOException
+         */
+        virtual void flush( void ) throw ( IOException );
+      
+        /**
+         * Clear current Stream contents
+         * @throws IOException
+         */
+        virtual void clear( void ) throw ( IOException );
+
+        /**
+         * Invokes close on the target output stream.
+         * @throws CMSException
+         */
+        void close( void ) throw( cms::CMSException );
 
    };
 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.cpp?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.cpp Fri Jul 21 04:36:09 2006
@@ -35,37 +35,35 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 EndianReader::~EndianReader()
-{
-    // no-op
-}
+{}
 
 ////////////////////////////////////////////////////////////////////////////////
-unsigned char EndianReader::readByte() throw(IOException)
+unsigned char EndianReader::readByte() throw( IOException )
 {
     unsigned char value ;
 
     // Read a single byte
-    read(&value, sizeof(unsigned char)) ;
-    return value ;
+    read(&value, sizeof(unsigned char));
+    return value;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-double EndianReader::readDouble() throw(IOException)
+double EndianReader::readDouble() throw( IOException )
 {
-    double value ;
+    double value;
 
     // Read a double and convert from big endian to little endian if necessary
-    read((unsigned char*)&value, sizeof(double) ) ;
+    read( (unsigned char*)&value, sizeof( double ) );
     return Endian::byteSwap(value) ;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-float EndianReader::readFloat() throw(IOException)
+float EndianReader::readFloat() throw( IOException )
 {
     float value ;
 
     // Read a float and convert from big endian to little endian if necessary
-    read((unsigned char*)&value, sizeof(float)) ;
+    read( (unsigned char*)&value, sizeof( float ) );
     return Endian::byteSwap(value) ;
 }
 
@@ -85,18 +83,18 @@
     uint32_t value;
 
     // Read an int and convert from big endian to little endian if necessary
-    read((unsigned char*)&value, sizeof(value)) ;
-    return Endian::byteSwap(value) ;
+    read( (unsigned char*)&value, sizeof( value ) );
+    return Endian::byteSwap(value);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 uint64_t EndianReader::readUInt64() throw(IOException)
 {
-    uint64_t value ;
+    uint64_t value;
 
     // Read a long long and convert from big endian to little endian if necessary
-    read((unsigned char*)&value, sizeof(value)) ;
-    return Endian::byteSwap(value) ;
+    read( (unsigned char*)&value, sizeof( value ) );
+    return Endian::byteSwap(value);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -118,7 +116,7 @@
 }*/
 
 ////////////////////////////////////////////////////////////////////////////////
-int EndianReader::read(unsigned char* buffer, int count) throw(IOException){
+int EndianReader::read( unsigned char* buffer, int count ) throw( IOException ){
 	
 	if( inputStream == NULL ){
 		throw IOException( __FILE__, __LINE__, 

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.h?rev=424272&r1=424271&r2=424272&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.h Fri Jul 21 04:36:09 2006
@@ -23,109 +23,110 @@
 namespace activemq{
 namespace io{
 
-	/*
-	 * The BinaryReader class reads primitive C++ data types from an
-	 * underlying input stream in a Java compatible way. Strings are
-	 * read as raw bytes, no character decoding is performed.
-	 *
-	 * All numeric data types are assumed to be available in big
-	 * endian (network byte order) and are converted automatically
-	 * to little endian if needed by the platform.
-	 *
-	 * Should any error occur an IOException will be thrown.
-	 */
-	class EndianReader : public Reader
-	{
-	private:
-	
-		/**
-		 * The target input stream.
-		 */
-		InputStream* inputStream;
-		
-	public:
-	
-		/**
-		 * Constructor.
-		 */
-		EndianReader();
-		
-		/**
-		 * Constructor.
-		 * @param is the target input stream.
-		 */
-	    EndianReader( InputStream* is );
-	    
-	    /**
-	     * Destructor.
-	     */
-	    virtual ~EndianReader();
-	
-		/**
-		 * Sets the target input stream.
-		 */
-		virtual void setInputStream( InputStream* is ){
-			inputStream = is;
-		}
-		
-		/**
-		 * Gets the target input stream.
-		 */
-	    virtual InputStream* getInputStream(){
-	    	return inputStream;
-	    }
-		
-		/**
-	     * Attempts to read an array of bytes from the stream.
-	     * @param buffer The target byte buffer.
-	     * @param count The number of bytes to read.
-	     * @return The number of bytes read.
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual int read(unsigned char* buffer, int count) throw(IOException);
-	    
-	    /**
-	     * Attempts to read a byte from the input stream
-	     * @return The byte.
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual unsigned char readByte() throw(IOException);
-	    
-	    /**
-	     * Attempts to read a double from the input stream
-	     * @return The byte.
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual double readDouble() throw(IOException);
-	    
-	    /**
-	     * Attempts to read a float from the input stream
-	     * @return The byte.
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual float readFloat() throw(IOException);
-	    
-	    /**
-	     * Attempts to read a short from the input stream
-	     * @return The byte.
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual uint16_t readUInt16() throw(IOException);
-	    
-	    /**
-	     * Attempts to read an int from the input stream
-	     * @return The byte.
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual uint32_t readUInt32() throw(IOException);
-	    
-	    /**
-	     * Attempts to read a long long from the input stream
-	     * @return The byte.
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual uint64_t readUInt64() throw(IOException);
-	};
+    /*
+     * The EndianReader class reads primitive C++ data types from an
+     * underlying input stream in a Java compatible way. Strings are
+     * read as raw bytes, no character decoding is performed.
+     *
+     * All numeric data types are assumed to be available in big
+     * endian (network byte order) and are converted automatically
+     * to little endian if needed by the platform.
+     *
+     * Should any error occur an IOException will be thrown.
+     */
+    class EndianReader : public Reader
+    {
+    private:
+    
+        /**
+         * The target input stream.
+         */
+        InputStream* inputStream;
+        
+    public:
+    
+        /**
+         * Constructor.
+         */
+        EndianReader();
+        
+        /**
+         * Constructor.
+         * @param is the target input stream.
+         */
+        EndianReader( InputStream* is );
+        
+        /**
+         * Destructor.
+         */
+        virtual ~EndianReader();
+    
+        /**
+         * Sets the target input stream.
+         */
+        virtual void setInputStream( InputStream* is ){
+            inputStream = is;
+        }
+        
+        /**
+         * Gets the target input stream.
+         */
+        virtual InputStream* getInputStream(){
+            return inputStream;
+        }
+        
+        /**
+         * Attempts to read an array of bytes from the stream.
+         * @param buffer The target byte buffer.
+         * @param count The number of bytes to read.
+         * @return The number of bytes read.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual int read( unsigned char* buffer, int count ) 
+            throw( IOException );
+        
+        /**
+         * Attempts to read a byte from the input stream
+         * @return The byte.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual unsigned char readByte() throw( IOException );
+        
+        /**
+         * Attempts to read a double from the input stream
+         * @return The byte.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual double readDouble() throw( IOException );
+        
+        /**
+         * Attempts to read a float from the input stream
+         * @return The byte.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual float readFloat() throw( IOException );
+        
+        /**
+         * Attempts to read a short from the input stream
+         * @return The byte.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual uint16_t readUInt16() throw( IOException );
+        
+        /**
+         * Attempts to read an int from the input stream
+         * @return The byte.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual uint32_t readUInt32() throw( IOException );
+        
+        /**
+         * Attempts to read a long long from the input stream
+         * @return The byte.
+         * @throws IOException thrown if an error occurs.
+         */
+        virtual uint64_t readUInt64() throw( IOException );
+    };
 
 }}
 



Mime
View raw message