activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r504412 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/utils/BooleanStream.h
Date Wed, 07 Feb 2007 02:03:57 GMT
Author: nmittler
Date: Tue Feb  6 18:03:57 2007
New Revision: 504412

URL: http://svn.apache.org/viewvc?view=rev&rev=504412
Log:
adding comments to how the OpenWire BooleanStream class encodes the size information

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/utils/BooleanStream.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/utils/BooleanStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/utils/BooleanStream.h?view=diff&rev=504412&r1=504411&r2=504412
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/utils/BooleanStream.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/utils/BooleanStream.h
Tue Feb  6 18:03:57 2007
@@ -27,11 +27,23 @@
 namespace utils{
 
     /**
-     * class to manage the writing and reading of boolean data streams
+     * Manages the writing and reading of boolean data streams
      * to and from a data source such as a DataInputStream or 
      * DataOutputStream.  The booleans are stored as single bits in the
      * stream, with the stream size pre-pended to the stream when the
      * data is marshalled.
+     * 
+     * The serialized form of the size field can be between 1 and 3 bytes.
+     * If the number of used bytes < 64, size=1 byte
+     * If the number of used bytes >=64 and < 256 (size of an unsigned byte), size=2
bytes
+     * If the number of used bytes >=256, size=3 bytes
+     * 
+     * The high-order 2 bits (128 and 64) of the first byte of the size field are
+     * used to encode the information about the number of bytes in the size field.  The
+     * only time the first byte will contain a value >=64 is if there are more bytes in
+     * the size field.  If the first byte < 64, the value of the byte is simply the size
+     * value.  If the first byte = 0xC0, the following unsigned byte is the size field. 

+     * If the first byte = 0x80, the following short (two bytes) are the size field.
      */
     class BooleanStream
     {



Mime
View raw message