summaryrefslogtreecommitdiff
path: root/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs')
-rw-r--r--dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs63
1 files changed, 39 insertions, 24 deletions
diff --git a/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs b/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs
index 5457b2301e..54ce8d023c 100644
--- a/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs
+++ b/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs
@@ -21,40 +21,55 @@
using System;
using System.Collections;
using Qpid.Framing;
+using Qpid.Buffer;
namespace Qpid.Client.Message
{
public class QpidTextMessageFactory : AbstractQmsMessageFactory
{
- protected override AbstractQmsMessage CreateMessageWithBody(ulong messageNbr, ContentHeaderBody contentHeader,
- IList bodies)
- {
- byte[] data;
-
- // we optimise the non-fragmented case to avoid copying
- if (bodies != null && bodies.Count == 1)
- {
- data = ((ContentBody)bodies[0]).Payload;
- }
- else
- {
- data = new byte[(int)contentHeader.BodySize];
- int currentPosition = 0;
- foreach (ContentBody cb in bodies)
- {
- Array.Copy(cb.Payload, 0, data, currentPosition, cb.Payload.Length);
- currentPosition += cb.Payload.Length;
- }
- }
-
- return new QpidTextMessage(messageNbr, data, (BasicContentHeaderProperties)contentHeader.Properties);
- }
+
+ // protected override AbstractQmsMessage CreateMessageWithBody(long messageNbr, ContentHeaderBody contentHeader,
+ // IList bodies)
+ // {
+ // byte[] data;
+
+ // // we optimise the non-fragmented case to avoid copying
+ // if (bodies != null && bodies.Count == 1)
+ // {
+ // data = ((ContentBody)bodies[0]).Payload;
+ // }
+ // else
+ // {
+ // data = new byte[(int)contentHeader.BodySize];
+ // int currentPosition = 0;
+ // foreach (ContentBody cb in bodies)
+ // {
+ // Array.Copy(cb.Payload, 0, data, currentPosition, cb.Payload.Length);
+ // currentPosition += cb.Payload.Length;
+ // }
+ // }
+
+ // return new QpidTextMessage(messageNbr, data, (BasicContentHeaderProperties)contentHeader.Properties);
+ // }
+ // public override AbstractQmsMessage CreateMessage()
+ // {
+ // return new QpidTextMessage();
+ // }
+
+
+
public override AbstractQmsMessage CreateMessage()
{
return new QpidTextMessage();
- }
+ }
+
+ protected override AbstractQmsMessage CreateMessage(long deliveryTag, ByteBuffer data, ContentHeaderBody contentHeader)
+ {
+ return new QpidTextMessage(deliveryTag, (BasicContentHeaderProperties) contentHeader.Properties, data);
+ }
+
}
}