activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r421378 - in /incubator/activemq/branches/activemq-4.0/activemq-dotnet: activemq-dotnet.csproj src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs
Date Wed, 12 Jul 2006 19:13:55 GMT
Author: chirino
Date: Wed Jul 12 12:13:54 2006
New Revision: 421378

URL: http://svn.apache.org/viewvc?rev=421378&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQ-719

Modified:
    incubator/activemq/branches/activemq-4.0/activemq-dotnet/activemq-dotnet.csproj
    incubator/activemq/branches/activemq-4.0/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs

Modified: incubator/activemq/branches/activemq-4.0/activemq-dotnet/activemq-dotnet.csproj
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/activemq-dotnet/activemq-dotnet.csproj?rev=421378&r1=421377&r2=421378&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/activemq-dotnet/activemq-dotnet.csproj (original)
+++ incubator/activemq/branches/activemq-4.0/activemq-dotnet/activemq-dotnet.csproj Wed Jul
12 12:13:54 2006
@@ -1,16 +1,4 @@
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
-    <PropertyGroup>
-        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-        <ProductVersion>8.0.30703</ProductVersion>
-        <SchemaVersion>2.0</SchemaVersion>
-        <ProjectGuid>{08321F42-4B3D-4815-B592-95962BAC3B9F}</ProjectGuid>
-        <OutputType>Library</OutputType>
-        <RootNamespace>activemq-dotnet</RootNamespace>
-        <AssemblyName>activemq-dotnet</AssemblyName>
-        <WarningLevel>4</WarningLevel>
-        <StartupObject/>
-    </PropertyGroup>
     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
         <DebugSymbols>true</DebugSymbols>
         <DebugType>full</DebugType>
@@ -26,6 +14,18 @@
         <DefineConstants>TRACE</DefineConstants>
         <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
     </PropertyGroup>
+    <PropertyGroup>
+        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+        <ProductVersion>8.0.30703</ProductVersion>
+        <SchemaVersion>2.0</SchemaVersion>
+        <ProjectGuid>{08321F42-4B3D-4815-B592-95962BAC3B9F}</ProjectGuid>
+        <OutputType>Library</OutputType>
+        <RootNamespace>activemq-dotnet</RootNamespace>
+        <AssemblyName>activemq-dotnet</AssemblyName>
+        <WarningLevel>4</WarningLevel>
+        <StartupObject/>
+    </PropertyGroup>
     <ItemGroup>
         <Reference Include="nunit.framework"/>
         <Reference Include="System"/>
@@ -54,9 +54,11 @@
         <Compile Include="src\main\csharp\ActiveMQ\Commands\BrokerId.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\Commands\BrokerInfo.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\Commands\Command.cs"/>
+        <Compile Include="src\main\csharp\ActiveMQ\Commands\ConnectionControl.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\Commands\ConnectionError.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\Commands\ConnectionId.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\Commands\ConnectionInfo.cs"/>
+        <Compile Include="src\main\csharp\ActiveMQ\Commands\ConsumerControl.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\Commands\ConsumerId.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\Commands\ConsumerInfo.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\Commands\ControlCommand.cs"/>
@@ -132,9 +134,11 @@
         <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\BaseCommandMarshaller.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\BrokerIdMarshaller.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\BrokerInfoMarshaller.cs"/>
+        <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConnectionControlMarshaller.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConnectionErrorMarshaller.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConnectionIdMarshaller.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConnectionInfoMarshaller.cs"/>
+        <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConsumerControlMarshaller.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConsumerIdMarshaller.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ConsumerInfoMarshaller.cs"/>
         <Compile Include="src\main\csharp\ActiveMQ\OpenWire\V1\ControlCommandMarshaller.cs"/>

Modified: incubator/activemq/branches/activemq-4.0/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs?rev=421378&r1=421377&r2=421378&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs
(original)
+++ incubator/activemq/branches/activemq-4.0/activemq-dotnet/src/main/csharp/ActiveMQ/Commands/ActiveMQTextMessage.cs
Wed Jul 12 12:13:54 2006
@@ -54,15 +54,14 @@
                 if (text == null)
                 {
                     // now lets read the content
-                    
                     byte[] data = this.Content;
                     if (data != null)
                     {
                         // TODO assume that the text is ASCII
-                        char[] chars = new char[data.Length];
+                        char[] chars = new char[data.Length-sizeof(int)];
                         for (int i = 0; i < chars.Length; i++)
                         {
-                            chars[i] = (char) data[i];
+                            chars[i] = (char) data[i+sizeof(int)];
                         }
                         text = new String(chars);
                     }
@@ -75,17 +74,31 @@
                 byte[] data = null;
                 if (text != null)
                 {
-                    // TODO assume that the text is ASCII
-                    data = new byte[text.Length];
-                    
-                    // now lets write the bytes
+					// TODO assume that the text is ASCII
+					
+                    byte[] sizePrefix = System.BitConverter.GetBytes(text.Length);
+					data = new byte[text.Length + sizePrefix.Length];  //int at the front of it
+															
+					// add the size prefix
+					for (int j = 0; j < sizePrefix.Length; j++)
+                    {
+						// The bytes need to be encoded in big endian
+						if ( BitConverter.IsLittleEndian ) {
+							data[j] = sizePrefix[sizePrefix.Length - j - 1];
+						} else {
+							data[j] = sizePrefix[j];
+						}
+                    }
+					
+					// Add the data.
                     char[] chars = text.ToCharArray();
-                    for (int i = 0; i < chars.Length; i++)
+					for (int i = 0; i < chars.Length; i++)
                     {
-                        data[i] = (byte) chars[i];
+                        data[i + sizePrefix.Length] = (byte)chars[i];
                     }
-                }
-                this.Content = data;
+				}
+				this.Content = data;
+					
             }
         }
     }



Mime
View raw message