You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2006/07/06 00:27:47 UTC

svn commit: r419365 [13/25] - in /incubator/activemq/trunk: activemq-core/src/main/java/org/apache/activemq/thread/ activemq-core/src/test/java/org/apache/activemq/openwire/v1/ activemq-cpp/src/main/activemq/concurrent/ activemq-cpp/src/main/activemq/c...

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=419365&r1=419364&r2=419365&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 Wed Jul  5 15:27:34 2006
@@ -1,173 +1,173 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _ACTIVEMQ_IO_BYTEARRAYINPUTSTREAM_H_
-#define _ACTIVEMQ_IO_BYTEARRAYINPUTSTREAM_H_
-
-#include <activemq/io/InputStream.h>
-#include <activemq/concurrent/Mutex.h>
-#include <vector>
-#include <algorithm>
-
-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;
-      
-   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();
-      }
-    
-      /**
-       * 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.  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());
-      }
-            
-      /**
-       * 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);
-
-   };
-
-}}
-
-#endif /*_ACTIVEMQ_IO_BYTEARRAYINPUTSTREAM_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACTIVEMQ_IO_BYTEARRAYINPUTSTREAM_H_
+#define _ACTIVEMQ_IO_BYTEARRAYINPUTSTREAM_H_
+
+#include <activemq/io/InputStream.h>
+#include <activemq/concurrent/Mutex.h>
+#include <vector>
+#include <algorithm>
+
+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;
+      
+   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();
+      }
+    
+      /**
+       * 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.  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());
+      }
+            
+      /**
+       * 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);
+
+   };
+
+}}
+
+#endif /*_ACTIVEMQ_IO_BYTEARRAYINPUTSTREAM_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayInputStream.h
------------------------------------------------------------------------------
    svn:eol-style = native

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=419365&r1=419364&r2=419365&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 Wed Jul  5 15:27:34 2006
@@ -1,62 +1,62 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-#include "ByteArrayOutputStream.h"
-#include <algorithm>
-
-using namespace activemq::io;
-using namespace std;
-
-////////////////////////////////////////////////////////////////////////////////
-void ByteArrayOutputStream::close() throw(cms::CMSException)
-{  
-   // Clear the Buffer
-   flush();
-}
-      
-////////////////////////////////////////////////////////////////////////////////
-void ByteArrayOutputStream::flush() throw (IOException)
-{
-    // No Op
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void ByteArrayOutputStream::clear() throw (IOException)
-{
-   // Empty the contents of the buffer to the output stream.
-   buffer.clear();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void ByteArrayOutputStream::write( const unsigned char c ) 
-   throw (IOException)
-{
-   buffer.push_back( c );  
-}
-
-////////////////////////////////////////////////////////////////////////////////    
-void ByteArrayOutputStream::write( const unsigned char* buffer, 
-                                   const int len ) 
-   throw (IOException)
-{     
-   // Iterate until all the data is written.
-   for( int ix = 0; ix < len; ++ix)
-   {
-      this->buffer.push_back( buffer[ix] );
-   }  
-}
-
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include "ByteArrayOutputStream.h"
+#include <algorithm>
+
+using namespace activemq::io;
+using namespace std;
+
+////////////////////////////////////////////////////////////////////////////////
+void ByteArrayOutputStream::close() throw(cms::CMSException)
+{  
+   // Clear the Buffer
+   flush();
+}
+      
+////////////////////////////////////////////////////////////////////////////////
+void ByteArrayOutputStream::flush() throw (IOException)
+{
+    // No Op
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ByteArrayOutputStream::clear() throw (IOException)
+{
+   // Empty the contents of the buffer to the output stream.
+   buffer.clear();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ByteArrayOutputStream::write( const unsigned char c ) 
+   throw (IOException)
+{
+   buffer.push_back( c );  
+}
+
+////////////////////////////////////////////////////////////////////////////////    
+void ByteArrayOutputStream::write( const unsigned char* buffer, 
+                                   const int len ) 
+   throw (IOException)
+{     
+   // Iterate until all the data is written.
+   for( int ix = 0; ix < len; ++ix)
+   {
+      this->buffer.push_back( buffer[ix] );
+   }  
+}
+

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

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=419365&r1=419364&r2=419365&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 Wed Jul  5 15:27:34 2006
@@ -1,170 +1,170 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _ACTIVEMQ_IO_BYTEARRAYOUTPUTSTREAM_H_
-#define _ACTIVEMQ_IO_BYTEARRAYOUTPUTSTREAM_H_
-
-#include <activemq/io/OutputStream.h>
-#include <activemq/concurrent/Mutex.h>
-#include <vector>
-
-namespace activemq{
-namespace io{
-
-   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();
-      }
-    
-      /**
-       * 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.  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();
-      }
-       
-      /**
-       * 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);
-
-   };
-
-}}
-
-#endif /*_ACTIVEMQ_IO_BYTEARRAYOUTPUTSTREAM_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ACTIVEMQ_IO_BYTEARRAYOUTPUTSTREAM_H_
+#define _ACTIVEMQ_IO_BYTEARRAYOUTPUTSTREAM_H_
+
+#include <activemq/io/OutputStream.h>
+#include <activemq/concurrent/Mutex.h>
+#include <vector>
+
+namespace activemq{
+namespace io{
+
+   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();
+      }
+    
+      /**
+       * 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.  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();
+      }
+       
+      /**
+       * 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);
+
+   };
+
+}}
+
+#endif /*_ACTIVEMQ_IO_BYTEARRAYOUTPUTSTREAM_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/ByteArrayOutputStream.h
------------------------------------------------------------------------------
    svn:eol-style = native

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=419365&r1=419364&r2=419365&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 Wed Jul  5 15:27:34 2006
@@ -1,129 +1,129 @@
-/* 
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "EndianReader.h"
-#include "../util/Endian.h"
-
-using namespace activemq::io;
-using namespace activemq::util;
-using namespace std;
-
-////////////////////////////////////////////////////////////////////////////////
-EndianReader::EndianReader()
-{
-    inputStream = NULL;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-EndianReader::EndianReader( InputStream* is )
-{
-    inputStream = is;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-EndianReader::~EndianReader()
-{
-    // no-op
-}
-
-////////////////////////////////////////////////////////////////////////////////
-unsigned char EndianReader::readByte() throw(IOException)
-{
-    unsigned char value ;
-
-    // Read a single byte
-    read(&value, sizeof(unsigned char)) ;
-    return value ;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-double EndianReader::readDouble() throw(IOException)
-{
-    double value ;
-
-    // Read a double and convert from big endian to little endian if necessary
-    read((unsigned char*)&value, sizeof(double) ) ;
-    return Endian::byteSwap(value) ;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-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)) ;
-    return Endian::byteSwap(value) ;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-uint16_t EndianReader::readUInt16() throw(IOException)
-{
-    uint16_t value;
-
-    // Read a short and byteswap
-    read((unsigned char*)&value, sizeof(value) );
-    return Endian::byteSwap(value);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-uint32_t EndianReader::readUInt32() throw(IOException)
-{
-    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) ;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-uint64_t EndianReader::readUInt64() throw(IOException)
-{
-    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) ;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/*string EndianReader::readString() throw(IOException)
-{
-    // Read length of string
-    short length = readShort() ;
-    char* buffer = new char[length+1] ;
-
-    // Read string bytes
-    read((unsigned char*)buffer, length) ;
-    *(buffer+length) = '\0' ;
-
-    // Create string class
-    string value;
-    value.assign(buffer) ;
-
-    return value ;
-}*/
-
-////////////////////////////////////////////////////////////////////////////////
-int EndianReader::read(unsigned char* buffer, int count) throw(IOException){
-	
-	if( inputStream == NULL ){
-		throw IOException( __FILE__, __LINE__, 
-            "EndianReader::read(char*,int) - input stream is NULL" );
-	}
-	
-	return inputStream->read( buffer, count );
-}
+/* 
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "EndianReader.h"
+#include "../util/Endian.h"
+
+using namespace activemq::io;
+using namespace activemq::util;
+using namespace std;
+
+////////////////////////////////////////////////////////////////////////////////
+EndianReader::EndianReader()
+{
+    inputStream = NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+EndianReader::EndianReader( InputStream* is )
+{
+    inputStream = is;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+EndianReader::~EndianReader()
+{
+    // no-op
+}
+
+////////////////////////////////////////////////////////////////////////////////
+unsigned char EndianReader::readByte() throw(IOException)
+{
+    unsigned char value ;
+
+    // Read a single byte
+    read(&value, sizeof(unsigned char)) ;
+    return value ;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+double EndianReader::readDouble() throw(IOException)
+{
+    double value ;
+
+    // Read a double and convert from big endian to little endian if necessary
+    read((unsigned char*)&value, sizeof(double) ) ;
+    return Endian::byteSwap(value) ;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+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)) ;
+    return Endian::byteSwap(value) ;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+uint16_t EndianReader::readUInt16() throw(IOException)
+{
+    uint16_t value;
+
+    // Read a short and byteswap
+    read((unsigned char*)&value, sizeof(value) );
+    return Endian::byteSwap(value);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+uint32_t EndianReader::readUInt32() throw(IOException)
+{
+    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) ;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+uint64_t EndianReader::readUInt64() throw(IOException)
+{
+    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) ;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/*string EndianReader::readString() throw(IOException)
+{
+    // Read length of string
+    short length = readShort() ;
+    char* buffer = new char[length+1] ;
+
+    // Read string bytes
+    read((unsigned char*)buffer, length) ;
+    *(buffer+length) = '\0' ;
+
+    // Create string class
+    string value;
+    value.assign(buffer) ;
+
+    return value ;
+}*/
+
+////////////////////////////////////////////////////////////////////////////////
+int EndianReader::read(unsigned char* buffer, int count) throw(IOException){
+	
+	if( inputStream == NULL ){
+		throw IOException( __FILE__, __LINE__, 
+            "EndianReader::read(char*,int) - input stream is NULL" );
+	}
+	
+	return inputStream->read( buffer, count );
+}

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

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=419365&r1=419364&r2=419365&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 Wed Jul  5 15:27:34 2006
@@ -1,132 +1,132 @@
-/* 
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef ACTIVEMQ_IO_ENDIANREADER_H
-#define ACTIVEMQ_IO_ENDIANREADER_H
-
-#include <activemq/io/Reader.h>
-#include <activemq/util/Endian.h>
-
-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);
-	};
-
-}}
-
-#endif /*ACTIVEMQ_IO_ENDIANREADER_H*/
+/* 
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ACTIVEMQ_IO_ENDIANREADER_H
+#define ACTIVEMQ_IO_ENDIANREADER_H
+
+#include <activemq/io/Reader.h>
+#include <activemq/util/Endian.h>
+
+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);
+	};
+
+}}
+
+#endif /*ACTIVEMQ_IO_ENDIANREADER_H*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianReader.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.cpp
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.cpp?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.cpp (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.cpp Wed Jul  5 15:27:34 2006
@@ -1,114 +1,114 @@
-/* 
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-#include "EndianWriter.h"
-#include <activemq/util/Endian.h>
-
-using namespace activemq::io;
-using namespace activemq::util;
-
-////////////////////////////////////////////////////////////////////////////////
-EndianWriter::EndianWriter()
-{
-    outputStream = NULL;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-EndianWriter::EndianWriter( OutputStream* os )
-{
-    outputStream = os;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-EndianWriter::~EndianWriter()
-{
-    // no-op
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void EndianWriter::writeByte(unsigned char value) throw(IOException)
-{
-    // Write a single byte
-    write(&value, sizeof(unsigned char));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void EndianWriter::writeDouble(double v) throw(IOException)
-{
-    // Write a double, byteswap if necessary
-    double value = Endian::byteSwap(v);
-    write((unsigned char*)&value, sizeof(value));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void EndianWriter::writeFloat(float v) throw(IOException)
-{
-    // Write a float, byteswap if necessary
-    float value = Endian::byteSwap(v);
-    write((unsigned char*)&value, sizeof(value));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void EndianWriter::writeUInt16(uint16_t v) throw(IOException)
-{
-    // Write a short, byteswap if necessary
-    uint16_t value = Endian::byteSwap(v) ;
-    write((unsigned char*)&value, sizeof(value));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void EndianWriter::writeUInt32(uint32_t v) throw(IOException)
-{
-    // Write an int, byteswap if necessary
-    uint32_t value = Endian::byteSwap(v);
-    write((unsigned char*)&value, sizeof(value));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void EndianWriter::writeUInt64(uint64_t v) throw(IOException)
-{
-    // Write a long long, byteswap if necessary
-    uint64_t value = Endian::byteSwap(v);
-    write((unsigned char*)&value, sizeof(value));
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/*void EndianWriter::writeString(const std::string& value) throw(IOException)
-{
-    // Assert argument
-    if( value.length() > USHRT_MAX ){
-        throw IOException("String length exceeds maximum length") ;
-    }
-    
-    // Write length of string
-    short length = (short)value.length() ;
-    writeShort( length ) ;
-
-    // Write string contents
-    write((unsigned char*)value.c_str(), length) ;
-}*/
-
-////////////////////////////////////////////////////////////////////////////////
-void EndianWriter::write(const unsigned char* buffer, int count) throw(IOException){
-	
-	if( outputStream == NULL ){
-		throw IOException( __FILE__, __LINE__, 
-            "EndianWriter::write(char*,int) - input stream is NULL" );
-	}
-	
-	outputStream->write( buffer, count );
-}
+/* 
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+#include "EndianWriter.h"
+#include <activemq/util/Endian.h>
+
+using namespace activemq::io;
+using namespace activemq::util;
+
+////////////////////////////////////////////////////////////////////////////////
+EndianWriter::EndianWriter()
+{
+    outputStream = NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+EndianWriter::EndianWriter( OutputStream* os )
+{
+    outputStream = os;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+EndianWriter::~EndianWriter()
+{
+    // no-op
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void EndianWriter::writeByte(unsigned char value) throw(IOException)
+{
+    // Write a single byte
+    write(&value, sizeof(unsigned char));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void EndianWriter::writeDouble(double v) throw(IOException)
+{
+    // Write a double, byteswap if necessary
+    double value = Endian::byteSwap(v);
+    write((unsigned char*)&value, sizeof(value));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void EndianWriter::writeFloat(float v) throw(IOException)
+{
+    // Write a float, byteswap if necessary
+    float value = Endian::byteSwap(v);
+    write((unsigned char*)&value, sizeof(value));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void EndianWriter::writeUInt16(uint16_t v) throw(IOException)
+{
+    // Write a short, byteswap if necessary
+    uint16_t value = Endian::byteSwap(v) ;
+    write((unsigned char*)&value, sizeof(value));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void EndianWriter::writeUInt32(uint32_t v) throw(IOException)
+{
+    // Write an int, byteswap if necessary
+    uint32_t value = Endian::byteSwap(v);
+    write((unsigned char*)&value, sizeof(value));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void EndianWriter::writeUInt64(uint64_t v) throw(IOException)
+{
+    // Write a long long, byteswap if necessary
+    uint64_t value = Endian::byteSwap(v);
+    write((unsigned char*)&value, sizeof(value));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/*void EndianWriter::writeString(const std::string& value) throw(IOException)
+{
+    // Assert argument
+    if( value.length() > USHRT_MAX ){
+        throw IOException("String length exceeds maximum length") ;
+    }
+    
+    // Write length of string
+    short length = (short)value.length() ;
+    writeShort( length ) ;
+
+    // Write string contents
+    write((unsigned char*)value.c_str(), length) ;
+}*/
+
+////////////////////////////////////////////////////////////////////////////////
+void EndianWriter::write(const unsigned char* buffer, int count) throw(IOException){
+	
+	if( outputStream == NULL ){
+		throw IOException( __FILE__, __LINE__, 
+            "EndianWriter::write(char*,int) - input stream is NULL" );
+	}
+	
+	outputStream->write( buffer, count );
+}

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.h Wed Jul  5 15:27:34 2006
@@ -1,132 +1,132 @@
-/* 
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef ACTIVEMQ_IO_ENDIANWRITER_H
-#define ACTIVEMQ_IO_ENDIANWRITER_H
-
-#include <activemq/io/Writer.h>
-#include <activemq/io/OutputStream.h>
-#include <activemq/util/Endian.h>
-
-namespace activemq{
-namespace io{
-
-	/*
-	 * The BinaryWriter class writes primitive C++ data types to an
-	 * underlying output stream in a Java compatible way. Strings
-	 * are written as raw bytes, no character encoding is performed.
-	 *
-	 * All numeric data types are written in big endian (network byte
-	 * order) and if the platform is little endian they are converted
-	 * automatically.
-	 *
-	 * Should any error occur an IOException will be thrown.
-	 */
-	class EndianWriter : public Writer
-	{
-	private:
-	
-		/**
-		 * Target output stream.
-		 */
-		OutputStream* outputStream;
-		
-	public:
-	
-		/**
-		 * Constructor.
-		 */
-	    EndianWriter();
-	    
-	    /**
-	     * Constructor.
-	     * @param os the target output stream.
-	     */
-	    EndianWriter( OutputStream* os );
-	    
-	    /**
-	     * Destructor.
-	     */
-	    virtual ~EndianWriter();
-	
-		/**
-		 * Sets the target output stream.
-		 */
-		virtual void setOutputStream( OutputStream* os ){
-			outputStream = os;
-		}
-		
-		/**
-		 * Gets the target output stream.
-		 */
-	    virtual OutputStream* getOutputStream(){
-	    	return outputStream;
-	    }
-	    
-	    /**
-	     * Writes a byte array to the target output stream.
-	     * @param buffer a byte array.
-	     * @param count the number of bytes to write.
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual void write(const unsigned char* buffer, int count) throw(IOException);
-	    
-	    /**
-	     * Writes a byte to the target output stream.
-	     * @param v the value to be written
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual void writeByte(unsigned char v) throw(IOException);
-	    
-	    /**
-	     * Writes a double to the target output stream.
-	     * @param v the value to be written
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual void writeDouble(double v) throw(IOException);
-	    
-	    /**
-	     * Writes a float to the target output stream.
-	     * @param v the value to be written
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual void writeFloat(float v) throw(IOException);
-	    
-	    /**
-	     * Writes a short to the target output stream.
-	     * @param v the value to be written
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual void writeUInt16(uint16_t v) throw(IOException);
-	    
-	    /**
-	     * Writes an int to the target output stream.
-	     * @param v the value to be written
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual void writeUInt32(uint32_t v) throw(IOException);
-	    
-	    /**
-	     * Writes a long long to the target output stream.
-	     * @param v the value to be written
-	     * @throws IOException thrown if an error occurs.
-	     */
-	    virtual void writeUInt64(uint64_t v) throw(IOException);
-	};
-
-}}
-
-#endif /*ACTIVEMQ_IO_ENDIANWRITER_H*/
+/* 
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ACTIVEMQ_IO_ENDIANWRITER_H
+#define ACTIVEMQ_IO_ENDIANWRITER_H
+
+#include <activemq/io/Writer.h>
+#include <activemq/io/OutputStream.h>
+#include <activemq/util/Endian.h>
+
+namespace activemq{
+namespace io{
+
+	/*
+	 * The BinaryWriter class writes primitive C++ data types to an
+	 * underlying output stream in a Java compatible way. Strings
+	 * are written as raw bytes, no character encoding is performed.
+	 *
+	 * All numeric data types are written in big endian (network byte
+	 * order) and if the platform is little endian they are converted
+	 * automatically.
+	 *
+	 * Should any error occur an IOException will be thrown.
+	 */
+	class EndianWriter : public Writer
+	{
+	private:
+	
+		/**
+		 * Target output stream.
+		 */
+		OutputStream* outputStream;
+		
+	public:
+	
+		/**
+		 * Constructor.
+		 */
+	    EndianWriter();
+	    
+	    /**
+	     * Constructor.
+	     * @param os the target output stream.
+	     */
+	    EndianWriter( OutputStream* os );
+	    
+	    /**
+	     * Destructor.
+	     */
+	    virtual ~EndianWriter();
+	
+		/**
+		 * Sets the target output stream.
+		 */
+		virtual void setOutputStream( OutputStream* os ){
+			outputStream = os;
+		}
+		
+		/**
+		 * Gets the target output stream.
+		 */
+	    virtual OutputStream* getOutputStream(){
+	    	return outputStream;
+	    }
+	    
+	    /**
+	     * Writes a byte array to the target output stream.
+	     * @param buffer a byte array.
+	     * @param count the number of bytes to write.
+	     * @throws IOException thrown if an error occurs.
+	     */
+	    virtual void write(const unsigned char* buffer, int count) throw(IOException);
+	    
+	    /**
+	     * Writes a byte to the target output stream.
+	     * @param v the value to be written
+	     * @throws IOException thrown if an error occurs.
+	     */
+	    virtual void writeByte(unsigned char v) throw(IOException);
+	    
+	    /**
+	     * Writes a double to the target output stream.
+	     * @param v the value to be written
+	     * @throws IOException thrown if an error occurs.
+	     */
+	    virtual void writeDouble(double v) throw(IOException);
+	    
+	    /**
+	     * Writes a float to the target output stream.
+	     * @param v the value to be written
+	     * @throws IOException thrown if an error occurs.
+	     */
+	    virtual void writeFloat(float v) throw(IOException);
+	    
+	    /**
+	     * Writes a short to the target output stream.
+	     * @param v the value to be written
+	     * @throws IOException thrown if an error occurs.
+	     */
+	    virtual void writeUInt16(uint16_t v) throw(IOException);
+	    
+	    /**
+	     * Writes an int to the target output stream.
+	     * @param v the value to be written
+	     * @throws IOException thrown if an error occurs.
+	     */
+	    virtual void writeUInt32(uint32_t v) throw(IOException);
+	    
+	    /**
+	     * Writes a long long to the target output stream.
+	     * @param v the value to be written
+	     * @throws IOException thrown if an error occurs.
+	     */
+	    virtual void writeUInt64(uint64_t v) throw(IOException);
+	};
+
+}}
+
+#endif /*ACTIVEMQ_IO_ENDIANWRITER_H*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/EndianWriter.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/IOException.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/IOException.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/IOException.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/IOException.h Wed Jul  5 15:27:34 2006
@@ -1,64 +1,64 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef ACTIVEMQ_IO_IOEXCEPTION_H
-#define ACTIVEMQ_IO_IOEXCEPTION_H
-
-#include <activemq/exceptions/ActiveMQException.h>
-
-namespace activemq{
-namespace io{
-
-	/*
-	 * Signals that an I/O exception of some sort has occurred.
-	 */
-	class IOException : public exceptions::ActiveMQException
-	{
-	public:
-	    IOException(){}
-        IOException( const exceptions::ActiveMQException& ex ){
-            *(exceptions::ActiveMQException*)this = ex;
-        }
-        IOException( const IOException& ex ){
-            *(exceptions::ActiveMQException*)this = ex;
-        }
-	    IOException(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 exceptions::ActiveMQException* clone() const{
-            return new IOException( *this );
-        }
-        
-	    virtual ~IOException(){}
-	    
-	};
-
-}}
-
-#endif /*ACTIVEMQ_IO_IOEXCEPTION_H*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ACTIVEMQ_IO_IOEXCEPTION_H
+#define ACTIVEMQ_IO_IOEXCEPTION_H
+
+#include <activemq/exceptions/ActiveMQException.h>
+
+namespace activemq{
+namespace io{
+
+	/*
+	 * Signals that an I/O exception of some sort has occurred.
+	 */
+	class IOException : public exceptions::ActiveMQException
+	{
+	public:
+	    IOException(){}
+        IOException( const exceptions::ActiveMQException& ex ){
+            *(exceptions::ActiveMQException*)this = ex;
+        }
+        IOException( const IOException& ex ){
+            *(exceptions::ActiveMQException*)this = ex;
+        }
+	    IOException(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 exceptions::ActiveMQException* clone() const{
+            return new IOException( *this );
+        }
+        
+	    virtual ~IOException(){}
+	    
+	};
+
+}}
+
+#endif /*ACTIVEMQ_IO_IOEXCEPTION_H*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/IOException.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/InputStream.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/OutputStream.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Reader.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Reader.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Reader.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Reader.h Wed Jul  5 15:27:34 2006
@@ -1,66 +1,66 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef ACTIVEMQ_IO_READER_H
-#define ACTIVEMQ_IO_READER_H
-
-#include <string>
-#include <activemq/io/IOException.h>
-#include <activemq/io/InputStream.h>
-
-namespace activemq{
-namespace io{
-
-	/*
-	 * Reader interface that wraps around an input stream and provides
-	 * an interface for extracting the data from the input stream.
-	 */
-	class Reader
-	{
-	public:
-	
-	    virtual ~Reader(){};
-	
-		/**
-		 * Sets the target input stream.
-		 */
-		virtual void setInputStream( InputStream* is ) = 0;
-		
-		/**
-		 * Gets the target input stream.
-		 */
-	    virtual InputStream* getInputStream() = 0;
-	    
-	    /**
-	     * 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) = 0;
-	    
-	    /**
-	     * 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) = 0;
-	} ;
-
-}}
-
-#endif /*ACTIVEMQ_IO_READER_H*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ACTIVEMQ_IO_READER_H
+#define ACTIVEMQ_IO_READER_H
+
+#include <string>
+#include <activemq/io/IOException.h>
+#include <activemq/io/InputStream.h>
+
+namespace activemq{
+namespace io{
+
+	/*
+	 * Reader interface that wraps around an input stream and provides
+	 * an interface for extracting the data from the input stream.
+	 */
+	class Reader
+	{
+	public:
+	
+	    virtual ~Reader(){};
+	
+		/**
+		 * Sets the target input stream.
+		 */
+		virtual void setInputStream( InputStream* is ) = 0;
+		
+		/**
+		 * Gets the target input stream.
+		 */
+	    virtual InputStream* getInputStream() = 0;
+	    
+	    /**
+	     * 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) = 0;
+	    
+	    /**
+	     * 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) = 0;
+	} ;
+
+}}
+
+#endif /*ACTIVEMQ_IO_READER_H*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Reader.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/StandardErrorOutputStream.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/StandardErrorOutputStream.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/StandardErrorOutputStream.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/StandardErrorOutputStream.h Wed Jul  5 15:27:34 2006
@@ -1,153 +1,153 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef _ACTIVEMQ_IO_STANDARDERROROUTPUTSTREAM_H_
-#define _ACTIVEMQ_IO_STANDARDERROROUTPUTSTREAM_H_
-
-#include <activemq/io/OutputStream.h>
-#include <activemq/concurrent/Mutex.h>
-
-#include <iostream>
-
-namespace activemq{
-namespace io{
-
-   class StandardErrorOutputStream : public OutputStream
-   {
-   private:
-   
-      /**
-       * Synchronization object.
-       */
-      concurrent::Mutex mutex;
-
-   public:
-
-      /**
-       * Constructor
-       */
-   	StandardErrorOutputStream(void) {}
-      
-      /**
-       * Destructor
-       */
-   	virtual ~StandardErrorOutputStream(void) {}
-
-      /**
-       * 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();
-      }
-        
-      /**
-       * 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();
-      }
-       
-      /**
-       * 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)
-      {
-         std::cerr << c;
-      }
-      
-      /**
-       * 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)
-      {
-         for(int i = 0; i < len; ++i)
-         {
-            std::cerr << buffer[i];
-         }
-      }
-      
-      /**
-       * Invokes flush on the target output stream.
-       */
-      virtual void flush() throw (IOException){
-         std::cerr.flush();
-      }
-      
-      /**
-       * Invokes close on the target output stream.
-       */
-      void close() throw(cms::CMSException){
-         std::cerr.flush();
-      }
-
-   };
-
-}
-
-#endif /*_ACTIVEMQ_IO_STANDARDERROROUTPUTSTREAM_H_*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef _ACTIVEMQ_IO_STANDARDERROROUTPUTSTREAM_H_
+#define _ACTIVEMQ_IO_STANDARDERROROUTPUTSTREAM_H_
+
+#include <activemq/io/OutputStream.h>
+#include <activemq/concurrent/Mutex.h>
+
+#include <iostream>
+
+namespace activemq{
+namespace io{
+
+   class StandardErrorOutputStream : public OutputStream
+   {
+   private:
+   
+      /**
+       * Synchronization object.
+       */
+      concurrent::Mutex mutex;
+
+   public:
+
+      /**
+       * Constructor
+       */
+   	StandardErrorOutputStream(void) {}
+      
+      /**
+       * Destructor
+       */
+   	virtual ~StandardErrorOutputStream(void) {}
+
+      /**
+       * 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();
+      }
+        
+      /**
+       * 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();
+      }
+       
+      /**
+       * 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)
+      {
+         std::cerr << c;
+      }
+      
+      /**
+       * 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)
+      {
+         for(int i = 0; i < len; ++i)
+         {
+            std::cerr << buffer[i];
+         }
+      }
+      
+      /**
+       * Invokes flush on the target output stream.
+       */
+      virtual void flush() throw (IOException){
+         std::cerr.flush();
+      }
+      
+      /**
+       * Invokes close on the target output stream.
+       */
+      void close() throw(cms::CMSException){
+         std::cerr.flush();
+      }
+
+   };
+
+}
+
+#endif /*_ACTIVEMQ_IO_STANDARDERROROUTPUTSTREAM_H_*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/StandardErrorOutputStream.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Writer.h
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Writer.h?rev=419365&r1=419364&r2=419365&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Writer.h (original)
+++ incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Writer.h Wed Jul  5 15:27:34 2006
@@ -1,65 +1,65 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors, as
- * applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef ACTIVEMQ_IO_WRITER_H
-#define ACTIVEMQ_IO_WRITER_H
-
-#include <string>
-#include <activemq/io/IOException.h>
-#include <activemq/io/OutputStream.h>
-
-namespace activemq{
-namespace io{
-
-   /*
-    * Writer interface for an object that wraps around an output
-    * stream 
-    */
-   class Writer
-   {
-   public:
-   
-      virtual ~Writer(){};
-       
-      /**
-       * Sets the target output stream.
-       */
-      virtual void setOutputStream( OutputStream* os ) = 0;
-       
-      /**
-       * Gets the target output stream.
-       */
-      virtual OutputStream* getOutputStream() = 0;
-             
-      /**
-       * Writes a byte array to the output stream.
-       * @param buffer a byte array
-       * @param count the number of bytes in the array to write.
-       * @throws IOException thrown if an error occurs.
-       */
-      virtual void write(const unsigned char* buffer, int count) throw(IOException) = 0;
-       
-       /**
-        * Writes a byte to the output stream.
-        * @param v The value to be written.
-        * @throws IOException thrown if an error occurs.
-        */
-       virtual void writeByte(unsigned char v) throw(IOException) = 0;
-   };
-
-}}
-
-#endif /*ACTIVEMQ_IO_WRITER_H*/
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors, as
+ * applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ACTIVEMQ_IO_WRITER_H
+#define ACTIVEMQ_IO_WRITER_H
+
+#include <string>
+#include <activemq/io/IOException.h>
+#include <activemq/io/OutputStream.h>
+
+namespace activemq{
+namespace io{
+
+   /*
+    * Writer interface for an object that wraps around an output
+    * stream 
+    */
+   class Writer
+   {
+   public:
+   
+      virtual ~Writer(){};
+       
+      /**
+       * Sets the target output stream.
+       */
+      virtual void setOutputStream( OutputStream* os ) = 0;
+       
+      /**
+       * Gets the target output stream.
+       */
+      virtual OutputStream* getOutputStream() = 0;
+             
+      /**
+       * Writes a byte array to the output stream.
+       * @param buffer a byte array
+       * @param count the number of bytes in the array to write.
+       * @throws IOException thrown if an error occurs.
+       */
+      virtual void write(const unsigned char* buffer, int count) throw(IOException) = 0;
+       
+       /**
+        * Writes a byte to the output stream.
+        * @param v The value to be written.
+        * @throws IOException thrown if an error occurs.
+        */
+       virtual void writeByte(unsigned char v) throw(IOException) = 0;
+   };
+
+}}
+
+#endif /*ACTIVEMQ_IO_WRITER_H*/

Propchange: incubator/activemq/trunk/activemq-cpp/src/main/activemq/io/Writer.h
------------------------------------------------------------------------------
    svn:eol-style = native