activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r593576 - /activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/BlockingByteArrayInputStream.h
Date Fri, 09 Nov 2007 15:59:38 GMT
Author: tabish
Date: Fri Nov  9 07:59:38 2007
New Revision: 593576

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

Modified:
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/BlockingByteArrayInputStream.h

Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/BlockingByteArrayInputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/BlockingByteArrayInputStream.h?rev=593576&r1=593575&r2=593576&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/BlockingByteArrayInputStream.h (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/BlockingByteArrayInputStream.h Fri
Nov  9 07:59:38 2007
@@ -144,6 +144,55 @@
         virtual std::size_t skip( std::size_t num )
             throw ( io::IOException, lang::exceptions::UnsupportedOperationException );
 
+        /**
+         * Marks the current position in the stream A subsequent call to the
+         * reset method repositions this stream at the last marked position so
+         * that subsequent reads re-read the same bytes.
+         *
+         * If a stream instance reports that marks are supported then the stream
+         * will ensure that the same bytes can be read again after the reset method
+         * is called so long the readLimit is not reached.
+         * @param readLimit - max bytes read before marked position is invalid.
+         */
+        virtual void mark( int readLimit DECAF_UNUSED ) {}
+
+        /**
+         * Repositions this stream to the position at the time the mark method was
+         * last called on this input stream.
+         *
+         * If the method markSupported returns true, then:
+         *   * If the method mark has not been called since the stream was created,
+         *     or the number of bytes read from the stream since mark was last called
+         * 	   is larger than the argument to mark at that last call, then an
+         *     IOException might be thrown.
+         *   * If such an IOException is not thrown, then the stream is reset to a
+         *     state such that all the bytes read since the most recent call to mark
+         *     (or since the start of the file, if mark has not been called) will be
+         *     resupplied to subsequent callers of the read method, followed by any
+         *     bytes that otherwise would have been the next input data as of the
+         *     time of the call to reset.
+         * If the method markSupported returns false, then:
+         *   * The call to reset may throw an IOException.
+         *   * If an IOException is not thrown, then the stream is reset to a fixed
+         *     state that depends on the particular type of the input stream and how
+         *     it was created. The bytes that will be supplied to subsequent callers
+         *     of the read method depend on the particular type of the input stream.
+         * @throws IOException
+         */
+        virtual void reset() throw ( IOException ) {
+            throw IOException(
+                __FILE__, __LINE__,
+                "BufferedInputStream::reset - mark no yet supported." );
+        }
+
+        /**
+         * Determines if this input stream supports the mark and reset methods.
+         * Whether or not mark and reset are supported is an invariant property of
+         * a particular input stream instance.
+         * @returns true if this stream instance supports marks
+         */
+        virtual bool markSupported() const{ return false; }
+
     public:
 
         /**



Mime
View raw message