0

I am using protobuf for serialisation to String. I have a report object to be passed to highchart template which I need to serialise to String. I am getting index out of bound exception while doing so. Please let me know why I am getting so. I am having one report object.

var report = new List<ReportViewModel>();
    report = CalculateOutputHelper.ConstructOverview(Convert.ToInt32(testId), eventName);           

        using (MemoryStream stream = new MemoryStream())
        {
            Serializer.Serialize(stream, report);
            var tempOutPut = Convert.ToBase64String(stream.ToArray());

            return tempOutPut;
        }
Claudia
  • 1,197
  • 15
  • 30
chai
  • 1
  • 5
  • in witch line ? `I am getting index out of bound exception while doing so` – Aristos May 19 '16 at 22:29
  • Serializer.Serialize(stream, report); – chai May 19 '16 at 22:32
  • Could you provide a little more of the surrounding code, so we can be a little more helpful? It's hard to help without enough context. I'm not as familiar with C# or Protocol Buffers, but it will help others more familiar with those to help you better. – Claudia May 19 '16 at 23:56
  • To fix your error look your data.... – Aristos May 20 '16 at 06:53
  • report is an object which is used as input to highchart template. – chai May 20 '16 at 18:14
  • report object is as attached below. Other JSON serialisers using JIL and service stack works fine. I am trying various methods to see the performance. – chai May 20 '16 at 18:17
  • - TimeAxis null double[] Title "Engine Speed" string XAxis null double[] xMax 2219790.0 double xMin 0.0 double XTitle "Time (microseconds)" string YTitle "Engine Speed (rpm)" string + Raw View – chai May 20 '16 at 18:18
  • I am passing report object which is a List. Is it ok to pass list object as an input to Serializer.Serialize() in protobuf-net. – chai May 20 '16 at 19:04

0 Answers0