activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1393808 [1/3] - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/
Date Wed, 03 Oct 2012 23:10:48 GMT
Author: tabish
Date: Wed Oct  3 23:10:47 2012
New Revision: 1393808

URL: http://svn.apache.org/viewvc?rev=1393808&view=rev
Log:
Polish up some of the code a bit, better destructor impls.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInput.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutput.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/EOFException.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/FileDescriptor.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/FileDescriptor.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/FilterInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/FilterOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStreamReader.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/InputStreamReader.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/OutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/OutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/OutputStreamWriter.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/OutputStreamWriter.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/PushbackInputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Reader.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/Writer.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.cpp?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.cpp Wed Oct  3 23:10:47 2012
@@ -30,45 +30,45 @@ BlockingByteArrayInputStream::BlockingBy
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-BlockingByteArrayInputStream::BlockingByteArrayInputStream( const unsigned char* buffer, int bufferSize ):
+BlockingByteArrayInputStream::BlockingByteArrayInputStream(const unsigned char* buffer, int bufferSize) :
     InputStream(), buffer(), pos(), closing(false) {
 
-    setByteArray( buffer, bufferSize );
+    setByteArray(buffer, bufferSize);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-BlockingByteArrayInputStream::~BlockingByteArrayInputStream(){
+BlockingByteArrayInputStream::~BlockingByteArrayInputStream() {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void BlockingByteArrayInputStream::setByteArray( const unsigned char* lbuffer, int lbufferSize ){
+void BlockingByteArrayInputStream::setByteArray(const unsigned char* lbuffer, int lbufferSize) {
 
-    synchronized( this ){
+    synchronized(this) {
 
         // Remove old data
         this->buffer.clear();
-        this->buffer.reserve( lbufferSize );
+        this->buffer.reserve(lbufferSize);
 
         // Copy data to internal buffer.
-        this->buffer.insert( this->buffer.begin(), lbuffer, lbuffer + lbufferSize );
+        this->buffer.insert(this->buffer.begin(), lbuffer, lbuffer + lbufferSize);
 
         // Begin at the Beginning.
         this->pos = this->buffer.begin();
 
-        // Notify any listening threds that there is now data available.
+        // Notify any listening threads that there is now data available.
         notifyAll();
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 int BlockingByteArrayInputStream::available() const {
-    return (int)std::distance( pos, buffer.end() );
+    return (int) std::distance(pos, buffer.end());
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void BlockingByteArrayInputStream::close() {
 
-    synchronized( this ){
+    synchronized(this) {
 
         // Indicate that we're shutting down.
         closing = true;
@@ -84,13 +84,13 @@ void BlockingByteArrayInputStream::close
 ////////////////////////////////////////////////////////////////////////////////
 int BlockingByteArrayInputStream::doReadByte() {
 
-    try{
+    try {
 
-        synchronized( this ){
+        synchronized(this) {
 
-            while( !closing ){
+            while (!closing) {
 
-                if( pos != buffer.end() ){
+                if (pos != buffer.end()) {
                     return *(pos++);
                 }
 
@@ -98,89 +98,81 @@ int BlockingByteArrayInputStream::doRead
                 wait();
             }
 
-            throw IOException( __FILE__, __LINE__, "close occurred during read" );
+            throw IOException(__FILE__, __LINE__, "close occurred during read");
         }
 
         return 0;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int BlockingByteArrayInputStream::doReadArrayBounded( unsigned char* buffer, int size, int offset, int length ) {
+int BlockingByteArrayInputStream::doReadArrayBounded(unsigned char* buffer, int size, int offset, int length) {
 
-    if( length == 0 ) {
+    if (length == 0) {
         return 0;
     }
 
-    if( buffer == NULL ) {
-        throw NullPointerException(
-            __FILE__, __LINE__,
-            "BlockingByteArrayInputStream::read - Passed buffer is Null" );
+    if (buffer == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "BlockingByteArrayInputStream::read - Passed buffer is Null");
     }
 
-    if( size < 0 ) {
-        throw IndexOutOfBoundsException(
-            __FILE__, __LINE__, "size parameter out of Bounds: %d.", size );
+    if (size < 0) {
+        throw IndexOutOfBoundsException(__FILE__, __LINE__, "size parameter out of Bounds: %d.", size);
     }
 
-    if( offset > size || offset < 0 ) {
-        throw IndexOutOfBoundsException(
-            __FILE__, __LINE__, "offset parameter out of Bounds: %d.", offset );
+    if (offset > size || offset < 0) {
+        throw IndexOutOfBoundsException(__FILE__, __LINE__, "offset parameter out of Bounds: %d.", offset);
     }
 
-    if( length < 0 || length > size - offset ) {
-        throw IndexOutOfBoundsException(
-            __FILE__, __LINE__, "length parameter out of Bounds: %d.", length );
+    if (length < 0 || length > size - offset) {
+        throw IndexOutOfBoundsException(__FILE__, __LINE__, "length parameter out of Bounds: %d.", length);
     }
 
     try {
 
-        synchronized( this ){
+        synchronized(this) {
 
             int ix = 0;
 
-            for( ; ix < length && !closing; ++ix ) {
+            for (; ix < length && !closing; ++ix) {
 
-                if( pos == this->buffer.end() ) {
+                if (pos == this->buffer.end()) {
                     // Wait for more data to come in.
                     wait();
                 }
 
-                if( !closing && pos != this->buffer.end() ){
+                if (!closing && pos != this->buffer.end()) {
                     buffer[ix + offset] = *(pos);
                     ++pos;
                 }
             }
 
-            if( closing ){
-                throw IOException(
-                    __FILE__, __LINE__,
-                    "BlockingByteArrayInputStream::read - close occurred during read" );
+            if (closing) {
+                throw IOException(__FILE__, __LINE__, "BlockingByteArrayInputStream::read - close occurred during read");
             }
 
-            return (int)ix;
+            return (int) ix;
         }
 
         return 0;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( NullPointerException )
-    DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(NullPointerException)
+    DECAF_CATCH_RETHROW(IndexOutOfBoundsException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-long long BlockingByteArrayInputStream::skip( long long num ) {
+long long BlockingByteArrayInputStream::skip(long long num) {
 
     long long ix = 0;
 
-    synchronized( this ){
-
+    synchronized(this) {
         // Increment the pos until we'v skipped the desired num
         // or we've hit the end of the buffer.
-        for( ; ix < num && !closing && pos != buffer.end(); ++ix, ++pos) {}
+        for (; ix < num && !closing && pos != buffer.end(); ++ix, ++pos) {}
     }
 
     return ix;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.h?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BlockingByteArrayInputStream.h Wed Oct  3 23:10:47 2012
@@ -50,8 +50,8 @@ namespace io{
 
     private:
 
-        BlockingByteArrayInputStream( const BlockingByteArrayInputStream& );
-        BlockingByteArrayInputStream& operator= ( const BlockingByteArrayInputStream& );
+        BlockingByteArrayInputStream(const BlockingByteArrayInputStream&);
+        BlockingByteArrayInputStream& operator=(const BlockingByteArrayInputStream&);
 
     public:
 
@@ -64,14 +64,14 @@ namespace io{
          * Constructor that initializes the internal buffer.
          * @see setByteArray.
          */
-        BlockingByteArrayInputStream( const unsigned char* buffer, int bufferSize );
+        BlockingByteArrayInputStream(const unsigned char* buffer, int bufferSize);
 
         virtual ~BlockingByteArrayInputStream();
 
         /**
          * {@inheritDoc}
          */
-        virtual void setByteArray( const unsigned char* buffer, int bufferSize );
+        virtual void setByteArray(const unsigned char* buffer, int bufferSize);
 
         /**
          * {@inheritDoc}
@@ -86,13 +86,13 @@ namespace io{
         /**
          * {@inheritDoc}
          */
-        virtual long long skip( long long num );
+        virtual long long skip(long long num);
 
     protected:
 
         virtual int doReadByte();
 
-        virtual int doReadArrayBounded( unsigned char* buffer, int size, int offset, int length );
+        virtual int doReadArrayBounded(unsigned char* buffer, int size, int offset, int length);
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.h?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedInputStream.h Wed Oct  3 23:10:47 2012
@@ -47,8 +47,8 @@ namespace io{
 
     private:
 
-        BufferedInputStream( const BufferedInputStream& );
-        BufferedInputStream& operator= ( const BufferedInputStream& );
+        BufferedInputStream(const BufferedInputStream&);
+        BufferedInputStream& operator=(const BufferedInputStream&);
 
     public:
 
@@ -60,7 +60,7 @@ namespace io{
          * @param own
          *      Indicates if we own the stream object, defaults to false.
          */
-        BufferedInputStream( InputStream* stream, bool own = false );
+        BufferedInputStream(InputStream* stream, bool own = false);
 
         /**
          * Constructor
@@ -74,7 +74,7 @@ namespace io{
          *
          * @throws IllegalArgumentException is the size is zero or negative.
          */
-        BufferedInputStream( InputStream* stream, int bufferSize, bool own = false );
+        BufferedInputStream(InputStream* stream, int bufferSize, bool own = false);
 
         virtual ~BufferedInputStream();
 
@@ -91,12 +91,12 @@ namespace io{
         /**
          * {@inheritDoc}
          */
-        virtual long long skip( long long num );
+        virtual long long skip(long long num);
 
         /**
          * {@inheritDoc}
          */
-        virtual void mark( int readLimit );
+        virtual void mark(int readLimit);
 
         /**
          * {@inheritDoc}
@@ -106,17 +106,19 @@ namespace io{
         /**
          * {@inheritDoc}
          */
-        virtual bool markSupported() const{ return true; }
+        virtual bool markSupported() const {
+            return true;
+        }
 
     protected:
 
         virtual int doReadByte();
 
-        virtual int doReadArrayBounded( unsigned char* buffer, int size, int offset, int length );
+        virtual int doReadArrayBounded(unsigned char* buffer, int size, int offset, int length);
 
     private:
 
-        int bufferData( InputStream* stream, unsigned char*& buffer );
+        int bufferData(InputStream* stream, unsigned char*& buffer);
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.h?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/BufferedOutputStream.h Wed Oct  3 23:10:47 2012
@@ -28,7 +28,7 @@ namespace io{
      * Wrapper around another output stream that buffers
      * output before writing to the target output stream.
      */
-    class DECAF_API BufferedOutputStream : public FilterOutputStream {
+    class DECAF_API BufferedOutputStream: public FilterOutputStream {
     private:
 
         /**
@@ -53,8 +53,8 @@ namespace io{
 
     private:
 
-        BufferedOutputStream( const BufferedOutputStream& );
-        BufferedOutputStream& operator= ( const BufferedOutputStream& );
+        BufferedOutputStream(const BufferedOutputStream&);
+        BufferedOutputStream& operator=(const BufferedOutputStream&);
 
     public:
 
@@ -66,7 +66,7 @@ namespace io{
          * @param own
          *      Indicates if this class owns the stream pointer.
          */
-        BufferedOutputStream( OutputStream* stream, bool own = false );
+        BufferedOutputStream(OutputStream* stream, bool own = false);
 
         /**
          * Constructor.
@@ -80,7 +80,7 @@ namespace io{
          *
          * @throws IllegalArgumentException if the bufferSize given is negative.
          */
-        BufferedOutputStream( OutputStream* stream, int bufferSize, bool own = false );
+        BufferedOutputStream(OutputStream* stream, int bufferSize, bool own = false);
 
         virtual ~BufferedOutputStream();
 
@@ -91,11 +91,11 @@ namespace io{
 
     protected:
 
-        virtual void doWriteByte( unsigned char c );
+        virtual void doWriteByte(unsigned char c);
 
-        virtual void doWriteArray( const unsigned char* buffer, int size );
+        virtual void doWriteArray(const unsigned char* buffer, int size);
 
-        virtual void doWriteArrayBounded( const unsigned char* buffer, int size, int offset, int length );
+        virtual void doWriteArrayBounded(const unsigned char* buffer, int size, int offset, int length);
 
     private:
 
@@ -105,14 +105,14 @@ namespace io{
          * @param bufferSize
          *      How large to make the initial buffer when creating it.
          */
-        void init( int bufferSize );
+        void init(int bufferSize);
 
         /**
          * Writes the contents of the buffer to the output stream.
          */
         void emptyBuffer();
 
-   };
+    };
 
 }}
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.cpp?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.cpp Wed Oct  3 23:10:47 2012
@@ -27,77 +27,71 @@ using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 ByteArrayInputStream::ByteArrayInputStream() :
-    InputStream(), buffer( NULL ), size( 0 ), own( false ), count( 0 ), pos( 0 ), markpos( 0 ){
+    InputStream(), buffer(NULL), size(0), own(false), count(0), pos(0), markpos(0) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ByteArrayInputStream::ByteArrayInputStream( const vector<unsigned char>& buffer ) :
-    InputStream(), buffer( NULL ), size( 0 ), own( false ), count( 0 ), pos( 0 ), markpos( 0 ) {
+ByteArrayInputStream::ByteArrayInputStream(const vector<unsigned char>& buffer) :
+    InputStream(), buffer(NULL), size(0), own(false), count(0), pos(0), markpos(0) {
 
-    if( buffer.size() > 0 ) {
-        setByteArray( &buffer[0], (int)buffer.size(), 0, (int)buffer.size() );
+    if (buffer.size() > 0) {
+        setByteArray(&buffer[0], (int) buffer.size(), 0, (int) buffer.size());
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ByteArrayInputStream::ByteArrayInputStream( const unsigned char* buffer, int bufferSize, bool own ) :
-    InputStream(), buffer( NULL ), size( 0 ), own( own ), count( 0 ), pos( 0 ), markpos( 0 ) {
+ByteArrayInputStream::ByteArrayInputStream(const unsigned char* buffer, int bufferSize, bool own) :
+    InputStream(), buffer(NULL), size(0), own(own), count(0), pos(0), markpos(0) {
 
-    setByteArray( buffer, bufferSize, 0, bufferSize );
+    setByteArray(buffer, bufferSize, 0, bufferSize);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ByteArrayInputStream::ByteArrayInputStream( const unsigned char* buffer, int bufferSize, int offset, int length, bool own ) :
-    InputStream(), buffer( NULL ), size( 0 ), own( own ), count( 0 ), pos( 0 ), markpos( 0 ) {
+ByteArrayInputStream::ByteArrayInputStream(const unsigned char* buffer, int bufferSize, int offset, int length, bool own) :
+    InputStream(), buffer(NULL), size(0), own(own), count(0), pos(0), markpos(0) {
 
-    setByteArray( buffer, bufferSize, offset, length );
+    setByteArray(buffer, bufferSize, offset, length);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ByteArrayInputStream::~ByteArrayInputStream(){
-    try{
-        if( this->own ) {
-            delete [] this->buffer;
+ByteArrayInputStream::~ByteArrayInputStream() {
+    try {
+        if (this->own) {
+            delete[] this->buffer;
         }
     }
     DECAF_CATCHALL_NOTHROW()
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayInputStream::setByteArray( const vector<unsigned char>& buffer ){
-
-    if( buffer.size() > 0 ) {
-        setByteArray( &buffer[0], (int)buffer.size(), 0, (int)buffer.size() );
+void ByteArrayInputStream::setByteArray(const vector<unsigned char>& buffer) {
+    if (buffer.size() > 0) {
+        setByteArray(&buffer[0], (int) buffer.size(), 0, (int) buffer.size());
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayInputStream::setByteArray( const unsigned char* buffer, int bufferSize ) {
-
-    setByteArray( buffer, bufferSize, 0, bufferSize );
+void ByteArrayInputStream::setByteArray(const unsigned char* buffer, int bufferSize) {
+    setByteArray(buffer, bufferSize, 0, bufferSize);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayInputStream::setByteArray( const unsigned char* buffer, int bufferSize, int offset, int length ) {
+void ByteArrayInputStream::setByteArray(const unsigned char* buffer, int bufferSize, int offset, int length) {
 
-    if( buffer == NULL ) {
-        throw NullPointerException(
-            __FILE__, __LINE__, "Input Buffer cannot be NULL." );
+    if (buffer == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "Input Buffer cannot be NULL.");
     }
 
-    if( bufferSize < 0 ) {
-        throw IllegalArgumentException(
-            __FILE__, __LINE__, "Size given for input buffer was negative." );
+    if (bufferSize < 0) {
+        throw IllegalArgumentException(__FILE__, __LINE__, "Size given for input buffer was negative.");
     }
 
-    if( offset < 0 ) {
-        throw IllegalArgumentException(
-            __FILE__, __LINE__, "Offset given was negative: %d.", offset );
+    if (offset < 0) {
+        throw IllegalArgumentException(__FILE__, __LINE__, "Offset given was negative: %d.", offset);
     }
 
-    if( length < 0 ) {
-        throw IllegalArgumentException(
-            __FILE__, __LINE__, "Length given was negative: %d.", offset );
+    if (length < 0) {
+        throw IllegalArgumentException(__FILE__, __LINE__, "Length given was negative: %d.", offset);
     }
 
     // We're using the default buffer.
@@ -110,12 +104,11 @@ void ByteArrayInputStream::setByteArray(
 
 ////////////////////////////////////////////////////////////////////////////////
 int ByteArrayInputStream::available() const {
-
     return this->count - this->pos;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayInputStream::mark( int readLimit DECAF_UNUSED ) {
+void ByteArrayInputStream::mark(int readLimit DECAF_UNUSED) {
 
     // the reset point is now the marked position until a new byte buffer
     // is set on this stream.
@@ -125,85 +118,79 @@ void ByteArrayInputStream::mark( int rea
 ////////////////////////////////////////////////////////////////////////////////
 void ByteArrayInputStream::reset() {
 
-    try{
+    try {
 
         // Begin at the Beginning if mark hasn't been called otherwise it
         // starts at the marked pos.
         this->pos = this->markpos;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 int ByteArrayInputStream::doReadByte() {
 
-    try{
+    try {
         return pos < count ? buffer[pos++] : -1;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-int ByteArrayInputStream::doReadArrayBounded( unsigned char* buffer, int size,
-                                              int offset, int length ) {
+int ByteArrayInputStream::doReadArrayBounded(unsigned char* buffer, int size, int offset, int length) {
 
-    try{
+    try {
 
-        if( length == 0 ) {
+        if (length == 0) {
             return 0;
         }
 
-        if( buffer == NULL ) {
-            throw NullPointerException(
-                __FILE__, __LINE__,
-                "ByteArrayInputStream::read - Buffer passed is Null" );
+        if (buffer == NULL) {
+            throw NullPointerException(__FILE__, __LINE__, "ByteArrayInputStream::read - Buffer passed is Null");
         }
 
-        if( size < 0 ) {
-            throw IndexOutOfBoundsException(
-                __FILE__, __LINE__, "size parameter out of Bounds: %d.", size );
+        if (size < 0) {
+            throw IndexOutOfBoundsException(__FILE__, __LINE__, "size parameter out of Bounds: %d.", size);
         }
 
-        if( offset > size || offset < 0 ) {
-            throw IndexOutOfBoundsException(
-                __FILE__, __LINE__, "offset parameter out of Bounds: %d.", offset );
+        if (offset > size || offset < 0) {
+            throw IndexOutOfBoundsException(__FILE__, __LINE__, "offset parameter out of Bounds: %d.", offset);
         }
 
-        if( length < 0 || length > size - offset ) {
-            throw IndexOutOfBoundsException(
-                __FILE__, __LINE__, "length parameter out of Bounds: %d.", length );
+        if (length < 0 || length > size - offset) {
+            throw IndexOutOfBoundsException(__FILE__, __LINE__, "length parameter out of Bounds: %d.", length);
         }
 
-        if( this->pos >= this->count ) {
+        if (this->pos >= this->count) {
             return -1;
         }
 
         int copylen = this->count - this->pos < length ? this->count - this->pos : length;
-        System::arraycopy( this->buffer, this->pos, buffer, offset, copylen );
+        System::arraycopy(this->buffer, this->pos, buffer, offset, copylen);
         this->pos += copylen;
         return copylen;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
-    DECAF_CATCH_RETHROW( NullPointerException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(IndexOutOfBoundsException)
+    DECAF_CATCH_RETHROW(NullPointerException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-long long ByteArrayInputStream::skip( long long num ) {
+long long ByteArrayInputStream::skip(long long num) {
 
-    try{
+    try {
 
-        if( num <= 0 ) {
+        if (num <= 0) {
             return 0;
         }
 
         int temp = this->pos;
-        this->pos = this->count - this->pos < num ? this->count : (int)(this->pos + num);
+        this->pos = this->count - this->pos < num ? this->count : (int) (this->pos + num);
         return this->pos - temp;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.h?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayInputStream.h Wed Oct  3 23:10:47 2012
@@ -39,7 +39,7 @@ namespace io{
      *
      * @since 1.0
      */
-    class DECAF_API ByteArrayInputStream : public InputStream {
+    class DECAF_API ByteArrayInputStream: public InputStream {
     private:
 
         /**
@@ -87,8 +87,8 @@ namespace io{
 
     private:
 
-        ByteArrayInputStream( const ByteArrayInputStream& );
-        ByteArrayInputStream& operator= ( const ByteArrayInputStream& );
+        ByteArrayInputStream(const ByteArrayInputStream&);
+        ByteArrayInputStream& operator=(const ByteArrayInputStream&);
 
     public:
 
@@ -105,7 +105,7 @@ namespace io{
          * @param buffer
          *      The buffer to be used.
          */
-        ByteArrayInputStream( const std::vector<unsigned char>& buffer );
+        ByteArrayInputStream(const std::vector<unsigned char>& buffer);
 
         /**
          * Create an instance of the ByteArrayInputStream with the given buffer as
@@ -121,7 +121,7 @@ namespace io{
          * @throws NullPointerException if the buffer is Null.
          * @throws IllegalArguementException if the bufferSize is negative.
          */
-        ByteArrayInputStream( const unsigned char* buffer, int bufferSize, bool own = false );
+        ByteArrayInputStream(const unsigned char* buffer, int bufferSize, bool own = false);
 
         /**
          * Create an instance of the ByteArrayInputStream with the given buffer as
@@ -141,7 +141,7 @@ namespace io{
          * @throws NullPointerException if the buffer is Null.
          * @throws IllegalArguementException if the bufferSize is negative.
          */
-        ByteArrayInputStream( const unsigned char* buffer, int bufferSize, int offset, int length, bool own = false );
+        ByteArrayInputStream(const unsigned char* buffer, int bufferSize, int offset, int length, bool own = false);
 
         virtual ~ByteArrayInputStream();
 
@@ -156,7 +156,7 @@ namespace io{
          * @param buffer
          *      The buffer to be used.
          */
-        virtual void setByteArray( const std::vector<unsigned char>& buffer );
+        virtual void setByteArray(const std::vector<unsigned char>& buffer);
 
         /**
          * Sets the data that this reader uses, replaces any existing
@@ -170,7 +170,7 @@ namespace io{
          * @throws NullPointerException if the buffer is Null.
          * @throws IllegalArguementException if the bufferSize is negative.
          */
-        virtual void setByteArray( const unsigned char* buffer, int bufferSize );
+        virtual void setByteArray(const unsigned char* buffer, int bufferSize);
 
         /**
          * Sets the data that this reader uses, replaces any existing
@@ -188,7 +188,7 @@ namespace io{
          * @throws NullPointerException if the buffer is Null.
          * @throws IllegalArguementException if the bufferSize is negative.
          */
-        virtual void setByteArray( const unsigned char* buffer, int bufferSize, int offset, int length );
+        virtual void setByteArray(const unsigned char* buffer, int bufferSize, int offset, int length);
 
         /**
          * {@inheritDoc}
@@ -198,12 +198,12 @@ namespace io{
         /**
          * {@inheritDoc}
          */
-        virtual long long skip( long long num );
+        virtual long long skip(long long num);
 
         /**
          * {@inheritDoc}
          */
-        virtual void mark( int readLimit );
+        virtual void mark(int readLimit);
 
         /**
          * {@inheritDoc}
@@ -213,13 +213,15 @@ namespace io{
         /**
          * {@inheritDoc}
          */
-        virtual bool markSupported() const{ return true; }
+        virtual bool markSupported() const {
+            return true;
+        }
 
     protected:
 
         virtual int doReadByte();
 
-        virtual int doReadArrayBounded( unsigned char* buffer, int size, int offset, int length );
+        virtual int doReadArrayBounded(unsigned char* buffer, int size, int offset, int length);
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp Wed Oct  3 23:10:47 2012
@@ -29,16 +29,15 @@ using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
 ByteArrayOutputStream::ByteArrayOutputStream() :
-    OutputStream(), buffer( new unsigned char[32] ), bufferSize( 32 ), count( 0 ) {
+    OutputStream(), buffer(new unsigned char[32]), bufferSize(32), count(0) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-ByteArrayOutputStream::ByteArrayOutputStream( int bufferSize ) :
-        OutputStream(), buffer( NULL ), bufferSize( bufferSize ), count( 0 ) {
+ByteArrayOutputStream::ByteArrayOutputStream(int bufferSize) :
+    OutputStream(), buffer(NULL), bufferSize(bufferSize), count(0) {
 
-    if( bufferSize <= 0 ) {
-        throw IllegalArgumentException(
-            __FILE__, __LINE__, "Buffer size given was invalid: %d", bufferSize );
+    if (bufferSize <= 0) {
+        throw IllegalArgumentException(__FILE__, __LINE__, "Buffer size given was invalid: %d", bufferSize);
     }
 
     this->buffer = new unsigned char[bufferSize];
@@ -46,10 +45,9 @@ ByteArrayOutputStream::ByteArrayOutputSt
 
 ////////////////////////////////////////////////////////////////////////////////
 ByteArrayOutputStream::~ByteArrayOutputStream() {
-    try{
-        delete [] buffer;
+    try {
+        delete[] buffer;
     }
-    DECAF_CATCH_NOTHROW( Exception )
     DECAF_CATCHALL_NOTHROW()
 }
 
@@ -58,14 +56,14 @@ std::pair<unsigned char*, int> ByteArray
 
     unsigned char* temp = NULL;
 
-    if( this->count == 0 ) {
-        return std::pair<unsigned char*, int>( temp, 0 );
+    if (this->count == 0) {
+        return std::pair<unsigned char*, int>(temp, 0);
     }
 
     temp = new unsigned char[this->count];
-    System::arraycopy( this->buffer, 0, temp, 0, this->count );
+    System::arraycopy(this->buffer, 0, temp, 0, this->count);
 
-    return std::make_pair( temp, this->count );
+    return std::make_pair(temp, this->count);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -79,111 +77,106 @@ void ByteArrayOutputStream::reset() {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayOutputStream::doWriteByte( unsigned char c ) {
+void ByteArrayOutputStream::doWriteByte(unsigned char c) {
 
-    try{
+    try {
 
-        if( this->count == this->bufferSize ) {
-            checkExpandSize( 1 );
+        if (this->count == this->bufferSize) {
+            checkExpandSize(1);
         }
 
         this->buffer[this->count++] = c;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW( IOException)
+    DECAF_CATCHALL_THROW( IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayOutputStream::doWriteArrayBounded( const unsigned char* buffer, int size, int offset, int length ) {
+void ByteArrayOutputStream::doWriteArrayBounded(const unsigned char* buffer, int size, int offset, int length) {
 
-    if( length == 0 ) {
+    if (length == 0) {
         return;
     }
 
-    if( buffer == NULL ) {
-        throw NullPointerException(
-            __FILE__, __LINE__, "passed buffer is null" );
+    if (buffer == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "passed buffer is null");
     }
 
-    if( size < 0 ) {
-        throw IndexOutOfBoundsException(
-            __FILE__, __LINE__, "size parameter out of Bounds: %d.", size );
+    if (size < 0) {
+        throw IndexOutOfBoundsException(__FILE__, __LINE__, "size parameter out of Bounds: %d.", size);
     }
 
-    if( offset > size || offset < 0 ) {
-        throw IndexOutOfBoundsException(
-            __FILE__, __LINE__, "offset parameter out of Bounds: %d.", offset );
+    if (offset > size || offset < 0) {
+        throw IndexOutOfBoundsException(__FILE__, __LINE__, "offset parameter out of Bounds: %d.", offset);
     }
 
-    if( length < 0 || length > size - offset ) {
-        throw IndexOutOfBoundsException(
-            __FILE__, __LINE__, "length parameter out of Bounds: %d.", length );
+    if (length < 0 || length > size - offset) {
+        throw IndexOutOfBoundsException(__FILE__, __LINE__, "length parameter out of Bounds: %d.", length);
     }
 
-    try{
+    try {
 
-        checkExpandSize( length );
+        checkExpandSize(length);
 
-        System::arraycopy( buffer, offset, this->buffer, this->count, length );
+        System::arraycopy(buffer, offset, this->buffer, this->count, length);
         this->count += length;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
-    DECAF_CATCH_RETHROW( NullPointerException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(IndexOutOfBoundsException)
+    DECAF_CATCH_RETHROW(NullPointerException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 std::string ByteArrayOutputStream::toString() const {
 
-    if( this->count == 0 ) {
+    if (this->count == 0) {
         return "";
     }
 
-    return string( (const char*)this->buffer, this->count );
+    return string((const char*) this->buffer, this->count);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayOutputStream::writeTo( OutputStream* out ) const {
+void ByteArrayOutputStream::writeTo(OutputStream* out) const {
 
-    try{
+    try {
 
-        if( this->count == 0 ) {
+        if (this->count == 0) {
             return;
         }
 
-        if( out == NULL ) {
-            throw NullPointerException(
-                __FILE__, __LINE__, "Passed stream pointer is null" );
+        if (out == NULL) {
+            throw NullPointerException(__FILE__, __LINE__, "Passed stream pointer is null");
         }
 
-        out->write( this->buffer, this->count );
+        out->write(this->buffer, this->count);
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_RETHROW( NullPointerException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_RETHROW(NullPointerException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ByteArrayOutputStream::checkExpandSize( int needed ) {
+void ByteArrayOutputStream::checkExpandSize(int needed) {
 
-    try{
+    try {
 
-        if( this->count + needed <= this->bufferSize ) {
+        if (this->count + needed <= this->bufferSize) {
             return;
         }
 
-        int newSize = ( this->count + needed ) * 2;
+        int newSize = (this->count + needed) * 2;
         unsigned char* temp = new unsigned char[newSize];
-        System::arraycopy( this->buffer, 0, temp, 0, this->count );
+        System::arraycopy(this->buffer, 0, temp, 0, this->count);
 
-        std::swap( temp, this->buffer );
+        std::swap(temp, this->buffer);
 
         this->bufferSize = newSize;
 
-        delete [] temp;
+        delete[] temp;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCH_EXCEPTION_CONVERT( Exception, IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCH_EXCEPTION_CONVERT(Exception, IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.h?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.h Wed Oct  3 23:10:47 2012
@@ -28,7 +28,7 @@
 namespace decaf{
 namespace io{
 
-    class DECAF_API ByteArrayOutputStream : public OutputStream {
+    class DECAF_API ByteArrayOutputStream: public OutputStream {
     private:
 
         /**
@@ -48,8 +48,8 @@ namespace io{
 
     private:
 
-        ByteArrayOutputStream( const ByteArrayOutputStream& );
-        ByteArrayOutputStream& operator= ( const ByteArrayOutputStream& );
+        ByteArrayOutputStream(const ByteArrayOutputStream&);
+        ByteArrayOutputStream& operator=(const ByteArrayOutputStream&);
 
     public:
 
@@ -68,7 +68,7 @@ namespace io{
          *
          * @throw IllegalArgumentException if the size is less than or equal to zero.
          */
-        ByteArrayOutputStream( int bufferSize );
+        ByteArrayOutputStream(int bufferSize);
 
         virtual ~ByteArrayOutputStream();
 
@@ -106,18 +106,18 @@ namespace io{
          * specified output stream argument, as if by calling the output
          * stream's write method using out.write( buf, 0, count ).
          */
-        void writeTo( OutputStream* out ) const;
+        void writeTo(OutputStream* out) const;
 
     protected:
 
-        virtual void doWriteByte( unsigned char value );
+        virtual void doWriteByte(unsigned char value);
 
-        virtual void doWriteArrayBounded( const unsigned char* buffer, int size, int offset, int length );
+        virtual void doWriteArrayBounded(const unsigned char* buffer, int size, int offset, int length);
 
     private:
 
         // Expands the buffer if there's not enough room for the needed length.
-        void checkExpandSize( int needed );
+        void checkExpandSize(int needed);
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInput.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInput.h?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInput.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInput.h Wed Oct  3 23:10:47 2012
@@ -51,7 +51,8 @@ namespace io {
     class DECAF_API DataInput {
     public:
 
-        virtual ~DataInput() {}
+        virtual ~DataInput() {
+        }
 
         /**
          * Reads in one byte and returns true if that byte is nonzero, false if that
@@ -266,7 +267,7 @@ namespace io {
          * @throws EOFException if the end of input is reached.
          * @throws IndexOutOfBoundsException if the size value is negative.
          */
-        virtual void readFully( unsigned char* buffer, int size ) = 0;
+        virtual void readFully(unsigned char* buffer, int size) = 0;
 
         /**
          * Reads length bytes from an input stream.
@@ -299,7 +300,7 @@ namespace io {
          * @throws NullPointerException if the buffer is NULL.
          * @throws IndexOutOfBoundsException if the offset + length > size, or an int param is negative.
          */
-        virtual void readFully( unsigned char* buffer, int size, int offset, int length ) = 0;
+        virtual void readFully(unsigned char* buffer, int size, int offset, int length) = 0;
 
         /**
          * Makes an attempt to skip over n bytes of data from the input stream,
@@ -316,7 +317,7 @@ namespace io {
          *
          * @throws IOException if an I/O Error occurs.
          */
-        virtual long long skipBytes( long long num ) = 0;
+        virtual long long skipBytes(long long num) = 0;
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.cpp?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.cpp Wed Oct  3 23:10:47 2012
@@ -34,58 +34,60 @@ using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-DataInputStream::DataInputStream( InputStream* inputStream, bool own )
- : FilterInputStream( inputStream, own ), buffer() {}
+DataInputStream::DataInputStream(InputStream* inputStream, bool own) :
+    FilterInputStream(inputStream, own), buffer() {
+}
 
 ////////////////////////////////////////////////////////////////////////////////
-DataInputStream::~DataInputStream() {}
+DataInputStream::~DataInputStream() {
+}
 
 ////////////////////////////////////////////////////////////////////////////////
 bool DataInputStream::readBoolean() {
 
     try {
-        readAllData( buffer, sizeof(char) );
-        return (bool)( buffer[0] != 0 );
+        readAllData(buffer, sizeof(char));
+        return (bool) (buffer[0] != 0);
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 char DataInputStream::readByte() {
 
     try {
-        readAllData( buffer, sizeof(unsigned char) );
-        return (char)( buffer[0] );
+        readAllData(buffer, sizeof(unsigned char));
+        return (char) (buffer[0]);
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 unsigned char DataInputStream::readUnsignedByte() {
 
     try {
-        readAllData( buffer, sizeof(unsigned char) );
+        readAllData(buffer, sizeof(unsigned char));
         return buffer[0];
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 char DataInputStream::readChar() {
 
     try {
-        readAllData( buffer, sizeof(unsigned char) );
-        return (char)( buffer[0] );
+        readAllData(buffer, sizeof(unsigned char));
+        return (char) (buffer[0]);
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -93,13 +95,13 @@ short DataInputStream::readShort() {
 
     try {
         short value = 0;
-        readAllData( buffer, sizeof(short) );
-        value |= (short)(buffer[0] << 8 | buffer[1] << 0);
+        readAllData(buffer, sizeof(short));
+        value |= (short) (buffer[0] << 8 | buffer[1] << 0);
         return value;
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -107,13 +109,13 @@ unsigned short DataInputStream::readUnsi
 
     try {
         unsigned short value = 0;
-        readAllData( buffer, sizeof(unsigned short) );
-        value |= (unsigned short)(buffer[0] << 8 | buffer[1] << 0);
+        readAllData(buffer, sizeof(unsigned short));
+        value |= (unsigned short) (buffer[0] << 8 | buffer[1] << 0);
         return value;
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -121,14 +123,13 @@ int DataInputStream::readInt() {
 
     try {
         unsigned int value = 0;
-        readAllData( buffer, sizeof(int) );
-        value |= (buffer[0] << 24 | buffer[1] << 16 |
-                  buffer[2] << 8 | buffer[3] << 0);
+        readAllData(buffer, sizeof(int));
+        value |= (buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3] << 0);
         return value;
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -137,12 +138,12 @@ double DataInputStream::readDouble() {
     try {
         unsigned long long lvalue = this->readLong();
         double value = 0.0;
-        memcpy( &value, &lvalue, sizeof( unsigned long long ) );
+        memcpy(&value, &lvalue, sizeof(unsigned long long));
         return value;
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -151,12 +152,12 @@ float DataInputStream::readFloat() {
     try {
         unsigned int lvalue = this->readInt();
         float value = 0.0f;
-        memcpy( &value, &lvalue, sizeof( unsigned int ) );
+        memcpy(&value, &lvalue, sizeof(unsigned int));
         return value;
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -164,7 +165,7 @@ long long DataInputStream::readLong() {
 
     try {
         unsigned long long value = 0;
-        readAllData( buffer, sizeof(long long) );
+        readAllData(buffer, sizeof(long long));
 
         // Have to do it this way because on Solaris and Cygwin we get all
         // kinds of warnings when shifting a byte up into a long long.
@@ -177,14 +178,13 @@ long long DataInputStream::readLong() {
         unsigned long long byte7 = buffer[6] & 0x00000000000000FFULL;
         unsigned long long byte8 = buffer[7] & 0x00000000000000FFULL;
 
-        value = ( byte1 << 56 | byte2 << 48 | byte3 << 40 | byte4 << 32 |
-                  byte5 << 24 | byte6 << 16 | byte7 << 8  | byte8 << 0 );
+        value = (byte1 << 56 | byte2 << 48 | byte3 << 40 | byte4 << 32 | byte5 << 24 | byte6 << 16 | byte7 << 8 | byte8 << 0);
 
         return value;
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -192,41 +192,37 @@ std::string DataInputStream::readString(
 
     try {
 
-        if( inputStream == NULL ) {
-            throw IOException(
-                __FILE__, __LINE__,
-                "DataInputStream::readFully - Base input stream is null" );
+        if (inputStream == NULL) {
+            throw IOException(__FILE__, __LINE__, "DataInputStream::readFully - Base input stream is null");
         }
 
         int size = 1024;
         std::vector<char> buffer;
-        buffer.resize( size );
+        buffer.resize(size);
         int pos = 0;
 
-        while( true ) {
+        while (true) {
 
-            if( inputStream->read( (unsigned char*)( &buffer[0] ), size, pos, 1 ) == -1 ) {
-                throw EOFException(
-                    __FILE__, __LINE__,
-                    "DataInputStream::readString - Reached EOF" );
+            if (inputStream->read((unsigned char*) (&buffer[0]), size, pos, 1) == -1) {
+                throw EOFException(__FILE__, __LINE__, "DataInputStream::readString - Reached EOF");
             }
 
             // if null is found we are done
-            if( buffer[pos] == '\0' ){
+            if (buffer[pos] == '\0') {
                 break;
             }
 
             // Resize to hold more if we exceed current size
-            if( ++pos >= size ) {
-                buffer.resize( (size *= 2) );
+            if (++pos >= size) {
+                buffer.resize((size *= 2));
             }
         }
 
         return &buffer[0];
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -234,66 +230,54 @@ std::string DataInputStream::readUTF() {
 
     try {
 
-        if( inputStream == NULL ) {
-            throw IOException(
-                __FILE__, __LINE__,
-                "DataInputStream::readFully - Base input stream is null" );
+        if (inputStream == NULL) {
+            throw IOException(__FILE__, __LINE__, "DataInputStream::readFully - Base input stream is null");
         }
 
         unsigned short utfLength = readUnsignedShort();
-        if( utfLength == 0 ) {
+        if (utfLength == 0) {
             return "";
         }
 
-        std::vector<unsigned char> buffer( utfLength );
-        std::vector<unsigned char> result( utfLength );
+        std::vector<unsigned char> buffer(utfLength);
+        std::vector<unsigned char> result(utfLength);
 
-        this->readFully( &buffer[0], utfLength );
+        this->readFully(&buffer[0], utfLength);
 
         std::size_t count = 0;
         std::size_t index = 0;
         unsigned char a = 0;
 
-        while( count < utfLength ) {
-            if( ( result[index] = buffer[count++] ) < 0x80 ) {
+        while (count < utfLength) {
+            if ((result[index] = buffer[count++]) < 0x80) {
                 index++;
-            } else if( ( ( a = result[index] ) & 0xE0 ) == 0xC0 ) {
-                if( count >= utfLength ) {
-                    throw UTFDataFormatException(
-                        __FILE__, __LINE__,
-                        "Invalid UTF-8 encoding found, start of two byte char found at end.");
+            } else if (((a = result[index]) & 0xE0) == 0xC0) {
+                if (count >= utfLength) {
+                    throw UTFDataFormatException(__FILE__, __LINE__, "Invalid UTF-8 encoding found, start of two byte char found at end.");
                 }
 
                 unsigned char b = buffer[count++];
-                if( ( b & 0xC0 ) != 0x80 ) {
-                    throw UTFDataFormatException(
-                        __FILE__, __LINE__,
-                        "Invalid UTF-8 encoding found, byte two does not start with 0x80." );
+                if ((b & 0xC0) != 0x80) {
+                    throw UTFDataFormatException(__FILE__, __LINE__, "Invalid UTF-8 encoding found, byte two does not start with 0x80.");
                 }
 
                 // 2-byte UTF8 encoding: 110X XXxx 10xx xxxx
                 // Bits set at 'X' means we have encountered a UTF8 encoded value
                 // greater than 255, which is not supported.
-                if( a & 0x1C ) {
-                    throw UTFDataFormatException(
-                        __FILE__, __LINE__,
-                        "Invalid 2 byte UTF-8 encoding found, "
-                        "This method only supports encoded ASCII values of (0-255)." );
+                if (a & 0x1C) {
+                    throw UTFDataFormatException(__FILE__, __LINE__, "Invalid 2 byte UTF-8 encoding found, "
+                            "This method only supports encoded ASCII values of (0-255).");
                 }
 
-                result[index++] = (unsigned char)( ( ( a & 0x1F ) << 6 ) | ( b & 0x3F ) );
+                result[index++] = (unsigned char) (((a & 0x1F) << 6) | (b & 0x3F));
 
-            } else if( ( a & 0xF0 ) == 0xE0 ) {
+            } else if ((a & 0xF0) == 0xE0) {
 
-                if( count + 1 >= utfLength ) {
-                    throw UTFDataFormatException(
-                        __FILE__, __LINE__,
-                        "Invalid UTF-8 encoding found, start of three byte char found at end.");
+                if (count + 1 >= utfLength) {
+                    throw UTFDataFormatException(__FILE__, __LINE__, "Invalid UTF-8 encoding found, start of three byte char found at end.");
                 } else {
-                    throw UTFDataFormatException(
-                        __FILE__, __LINE__,
-                        "Invalid 3 byte UTF-8 encoding found, "
-                        "This method only supports encoded ASCII values of (0-255)." );
+                    throw UTFDataFormatException(__FILE__, __LINE__, "Invalid 3 byte UTF-8 encoding found, "
+                            "This method only supports encoded ASCII values of (0-255).");
                 }
 
                 // If we were to support multibyte strings in the future this would be
@@ -311,194 +295,182 @@ std::string DataInputStream::readUTF() {
                 //                 ( ( b & 0x3F ) << 6 ) | ( c & 0x3F );
 
             } else {
-                throw UTFDataFormatException(
-                    __FILE__, __LINE__, "Invalid UTF-8 encoding found, aborting.");
+                throw UTFDataFormatException(__FILE__, __LINE__, "Invalid UTF-8 encoding found, aborting.");
             }
         }
 
-        return std::string( (char*)( &result[0] ), index );
+        return std::string((char*) (&result[0]), index);
     }
-    DECAF_CATCH_RETHROW( UTFDataFormatException )
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(UTFDataFormatException)
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void DataInputStream::readFully( unsigned char* buffer, int size ) {
+void DataInputStream::readFully(unsigned char* buffer, int size) {
 
     try {
 
-        if( size == 0 ) {
+        if (size == 0) {
             return;
         }
 
-        this->readFully( buffer, size, 0, size );
+        this->readFully(buffer, size, 0, size);
     }
-    DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IndexOutOfBoundsException)
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 std::string DataInputStream::readLine() {
-    try{
+    try {
 
         std::string line;
         bool foundTerminator = false;
 
-        while( true ) {
+        while (true) {
 
             int nextByte = inputStream->read();
 
-            if( nextByte == -1 ) {
+            if (nextByte == -1) {
 
-                if( line.length() == 0 && !foundTerminator ) {
+                if (line.length() == 0 && !foundTerminator) {
                     return "";
                 }
                 return line;
 
-            } else if( nextByte == (unsigned char)'\r' ) {
+            } else if (nextByte == (unsigned char) '\r') {
 
-                PushbackInputStream* pbStream = dynamic_cast<PushbackInputStream*>( inputStream );
+                PushbackInputStream* pbStream = dynamic_cast<PushbackInputStream*>(inputStream);
 
-                if( foundTerminator ) {
+                if (foundTerminator) {
 
-                    if( pbStream == NULL ) {
-                        throw IOException( __FILE__, __LINE__, "State is not valid, parse failed." );
+                    if (pbStream == NULL) {
+                        throw IOException(__FILE__, __LINE__, "State is not valid, parse failed.");
                     }
 
-                    pbStream->unread( (unsigned char)nextByte );
+                    pbStream->unread((unsigned char) nextByte);
                     return line;
                 }
 
                 foundTerminator = true;
 
                 // Have to be able to peek ahead one byte to see if its an newline.
-                if( pbStream == NULL ) {
-                    inputStream = new PushbackInputStream( inputStream, own );
+                if (pbStream == NULL) {
+                    inputStream = new PushbackInputStream(inputStream, own);
                     own = true;
                 }
 
-            } else if( nextByte == (unsigned char)'\n' ) {
+            } else if (nextByte == (unsigned char) '\n') {
 
                 return line;
 
             } else {
 
-                if( foundTerminator ) {
-                    PushbackInputStream* pbStream = dynamic_cast<PushbackInputStream*>( inputStream );
+                if (foundTerminator) {
+                    PushbackInputStream* pbStream = dynamic_cast<PushbackInputStream*>(inputStream);
 
-                    if( pbStream == NULL ) {
-                        throw IOException( __FILE__, __LINE__, "State is not valid, parse failed." );
+                    if (pbStream == NULL) {
+                        throw IOException(__FILE__, __LINE__, "State is not valid, parse failed.");
                     }
 
-                    pbStream->unread( (unsigned char)nextByte );
+                    pbStream->unread((unsigned char) nextByte);
                     return line;
                 }
 
-                line += (char)nextByte;
+                line += (char) nextByte;
             }
         }
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void DataInputStream::readFully( unsigned char* buffer, int size, int offset, int length ) {
+void DataInputStream::readFully(unsigned char* buffer, int size, int offset, int length) {
 
     try {
 
-        if( length == 0 ) {
+        if (length == 0) {
             return;
         }
 
-        if( buffer == NULL ) {
-            throw NullPointerException(
-                __FILE__, __LINE__, "Buffer is null" );
+        if (buffer == NULL) {
+            throw NullPointerException(__FILE__, __LINE__, "Buffer is null");
         }
 
-        if( inputStream == NULL ) {
-            throw NullPointerException(
-                __FILE__, __LINE__, "Base input stream is null" );
+        if (inputStream == NULL) {
+            throw NullPointerException(__FILE__, __LINE__, "Base input stream is null");
         }
 
-        if( size < 0 ) {
-            throw IndexOutOfBoundsException(
-                __FILE__, __LINE__, "size parameter out of Bounds: %d.", size );
+        if (size < 0) {
+            throw IndexOutOfBoundsException(__FILE__, __LINE__, "size parameter out of Bounds: %d.", size);
         }
 
-        if( offset > size || offset < 0 ) {
-            throw IndexOutOfBoundsException(
-                __FILE__, __LINE__, "offset parameter out of Bounds: %d.", offset );
+        if (offset > size || offset < 0) {
+            throw IndexOutOfBoundsException(__FILE__, __LINE__, "offset parameter out of Bounds: %d.", offset);
         }
 
-        if( length < 0 || length > size - offset ) {
-            throw IndexOutOfBoundsException(
-                __FILE__, __LINE__, "length parameter out of Bounds: %d.", length );
+        if (length < 0 || length > size - offset) {
+            throw IndexOutOfBoundsException(__FILE__, __LINE__, "length parameter out of Bounds: %d.", length);
         }
 
         int n = 0;
-        while( n < length ) {
-            int count = inputStream->read( buffer, length, offset + n, length - n );
-            if( count == -1 ) {
-                throw EOFException(
-                    __FILE__, __LINE__, "Reached EOF" );
+        while (n < length) {
+            int count = inputStream->read(buffer, length, offset + n, length - n);
+            if (count == -1) {
+                throw EOFException(__FILE__, __LINE__, "Reached EOF");
             }
             n += count;
         }
     }
-    DECAF_CATCH_RETHROW( NullPointerException )
-    DECAF_CATCH_RETHROW( IndexOutOfBoundsException )
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(NullPointerException)
+    DECAF_CATCH_RETHROW(IndexOutOfBoundsException)
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-long long DataInputStream::skipBytes( long long num ) {
+long long DataInputStream::skipBytes(long long num) {
 
     try {
 
-        if( inputStream == NULL ) {
-            throw IOException(
-                __FILE__, __LINE__,
-                "DataInputStream::readFully - Base input stream is null" );
+        if (inputStream == NULL) {
+            throw IOException(__FILE__, __LINE__, "DataInputStream::readFully - Base input stream is null");
         }
 
         long long total = 0;
         long long cur = 0;
 
-        while( ( total < num ) &&
-               ( ( cur = inputStream->skip( num-total ) ) > 0 ) ) {
+        while ((total < num) && ((cur = inputStream->skip(num - total)) > 0)) {
             total += cur;
         }
 
         return total;
     }
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void DataInputStream::readAllData( unsigned char* buffer, int length ) {
+void DataInputStream::readAllData(unsigned char* buffer, int length) {
 
-    try{
+    try {
 
         int n = 0;
-        do{
-            int count = inputStream->read( buffer, length, n, length - n );
-            if( count == -1 ) {
-                throw EOFException(
-                    __FILE__, __LINE__,
-                    "DataInputStream::readLong - Reached EOF" );
+        do {
+            int count = inputStream->read(buffer, length, n, length - n);
+            if (count == -1) {
+                throw EOFException(__FILE__, __LINE__, "DataInputStream::readLong - Reached EOF");
             }
             n += count;
-        } while( n < length );
+        } while (n < length);
     }
-    DECAF_CATCH_RETHROW( EOFException )
-    DECAF_CATCH_RETHROW( IOException )
-    DECAF_CATCHALL_THROW( IOException )
+    DECAF_CATCH_RETHROW(EOFException)
+    DECAF_CATCH_RETHROW(IOException)
+    DECAF_CATCHALL_THROW(IOException)
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.h?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataInputStream.h Wed Oct  3 23:10:47 2012
@@ -43,7 +43,7 @@ namespace io{
      *
      *  @since 1.0
      */
-    class DECAF_API DataInputStream : public FilterInputStream {
+    class DECAF_API DataInputStream: public FilterInputStream {
     private:
 
         // Buffer used to store bytes read from the stream while reconstructed into
@@ -52,8 +52,8 @@ namespace io{
 
     private:
 
-        DataInputStream( const DataInputStream& );
-        DataInputStream& operator= ( const DataInputStream& );
+        DataInputStream(const DataInputStream&);
+        DataInputStream& operator=(const DataInputStream&);
 
     public:
 
@@ -64,11 +64,12 @@ namespace io{
          * @param own indicates if this class owns the wrapped string
          * defaults to false.
          */
-        DataInputStream( InputStream* inputStream, bool own = false );
+        DataInputStream(InputStream* inputStream, bool own = false);
 
         virtual ~DataInputStream();
 
-    public:  // DataInput
+    public:
+        // DataInput
 
         /**
          * Reads in one byte and returns true if that byte is nonzero, false if that
@@ -283,7 +284,7 @@ namespace io{
          * @throws EOFException if the end of input is reached.
          * @throws IndexOutOfBoundsException if the size value is negative.
          */
-        virtual void readFully( unsigned char* buffer, int size );
+        virtual void readFully(unsigned char* buffer, int size);
 
         /**
          * Reads length bytes from an input stream.
@@ -316,7 +317,7 @@ namespace io{
          * @throws NullPointerException if the buffer is NULL.
          * @throws IndexOutOfBoundsException if the offset + length > size.
          */
-        virtual void readFully( unsigned char* buffer, int size, int offset, int length );
+        virtual void readFully(unsigned char* buffer, int size, int offset, int length);
 
         /**
          * Makes an attempt to skip over n bytes of data from the input stream,
@@ -333,12 +334,12 @@ namespace io{
          *
          * @throws IOException if an I/O Error occurs.
          */
-        virtual long long skipBytes( long long num );
+        virtual long long skipBytes(long long num);
 
     private:
 
         // Used internally to reliably get data from the underlying stream
-        void readAllData( unsigned char* buffer, int length );
+        void readAllData(unsigned char* buffer, int length);
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutput.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutput.h?rev=1393808&r1=1393807&r2=1393808&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutput.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/DataOutput.h Wed Oct  3 23:10:47 2012
@@ -47,7 +47,8 @@ namespace io {
     class DECAF_API DataOutput {
     public:
 
-        virtual ~DataOutput() {}
+        virtual ~DataOutput() {
+        }
 
         /**
          * Writes a boolean to the underlying output stream as a 1-byte value. The
@@ -60,7 +61,7 @@ namespace io {
          *
          * @throws IOException if an I/O error is encountered.
          */
-        virtual void writeBoolean( bool value ) = 0;
+        virtual void writeBoolean(bool value) = 0;
 
         /**
          * Writes out a byte to the underlying output stream as a 1-byte
@@ -72,7 +73,7 @@ namespace io {
          *
          * @throws IOException if an I/O error is encountered.
          */
-        virtual void writeByte( unsigned char value ) = 0;
+        virtual void writeByte(unsigned char value) = 0;
 
         /**
          * Writes a short to the underlying output stream as two bytes, high
@@ -84,7 +85,7 @@ namespace io {
          *
          * @throws IOException if an I/O error is encountered.
          */
-        virtual void writeShort( short value ) = 0;
+        virtual void writeShort(short value) = 0;
 
         /**
          * Writes a unsigned short to the bytes message stream as a 2 byte value
@@ -94,7 +95,7 @@ namespace io {
          *
          * @throws IOException if an I/O error is encountered.
          */
-        virtual void writeUnsignedShort( unsigned short value ) = 0;
+        virtual void writeUnsignedShort(unsigned short value) = 0;
 
         /**
          * Writes out a char to the underlying output stream as a one byte
@@ -106,7 +107,7 @@ namespace io {
          *
          * @throws IOException if an I/O error is encountered.
          */
-        virtual void writeChar( char value ) = 0;
+        virtual void writeChar(char value) = 0;
 
         /**
          * Writes an int to the underlying output stream as four bytes, high
@@ -118,7 +119,7 @@ namespace io {
          *
          * @throws IOException if an I/O error is encountered.
          */
-        virtual void writeInt( int value ) = 0;
+        virtual void writeInt(int value) = 0;
 
         /**
          * Writes an 64 bit long to the underlying output stream as eight
@@ -130,7 +131,7 @@ namespace io {
          *
          * @throws IOException if an I/O error is encountered.
          */
-        virtual void writeLong( long long value ) = 0;
+        virtual void writeLong(long long value) = 0;
 
         /**
          * Converts the float argument to an int using the floatToIntBits
@@ -144,7 +145,7 @@ namespace io {
          *
          * @throws IOException if an I/O error is encountered.
          */
-        virtual void writeFloat( float value ) = 0;
+        virtual void writeFloat(float value) = 0;
 
         /**
          * Converts the double argument to a long using the doubleToLongBits
@@ -158,7 +159,7 @@ namespace io {
          *
          * @throws IOException if an I/O error is encountered.
          */
-        virtual void writeDouble( double value ) = 0;
+        virtual void writeDouble(double value) = 0;
 
         /**
          * Writes out the string to the underlying output stream as a
@@ -174,7 +175,7 @@ namespace io {
          *
          * @throws IOException if an I/O error is encountered.
          */
-        virtual void writeBytes( const std::string& value ) = 0;
+        virtual void writeBytes(const std::string& value) = 0;
 
         /**
          * Writes a string to the underlying output stream as a sequence of
@@ -188,7 +189,7 @@ namespace io {
          *
          * @throws IOException if an I/O error is encountered.
          */
-        virtual void writeChars( const std::string& value ) = 0;
+        virtual void writeChars(const std::string& value) = 0;
 
         /**
          * Writes out the string to the underlying output stream as a modeified UTF-8
@@ -203,7 +204,7 @@ namespace io {
          * @throws IOException if an I/O error is encountered.
          * @throws UTFDataFormatException if the encoded size if greater than 65535
          */
-        virtual void writeUTF( const std::string& value ) = 0;
+        virtual void writeUTF(const std::string& value) = 0;
 
     };
 



Mime
View raw message