diff options
| author | Steven Shaw <steshaw@apache.org> | 2006-11-29 05:51:43 +0000 |
|---|---|---|
| committer | Steven Shaw <steshaw@apache.org> | 2006-11-29 05:51:43 +0000 |
| commit | 5924742a77953f3de8776d9b45e2396c605f1aa2 (patch) | |
| tree | 5a06c3c010957b260291346fb954be72e77a5a55 /qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs | |
| parent | 260e96b8c02b021d237bec653bdc753488d96308 (diff) | |
| download | qpid-python-5924742a77953f3de8776d9b45e2396c605f1aa2.tar.gz | |
QPID-137. First stab at porting enough to get AutoAcknowledge mode working.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@480423 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs')
| -rw-r--r-- | qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs b/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs index 5457b2301e..54ce8d023c 100644 --- a/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs +++ b/qpid/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); + } + } } |
