Thanks Nadav. It worked for conversion of byte. But, my actual problem seems like different and I was at wrong place in debugging., I have posted the actual issue here ., https://groups.google.com/d/msg/protobuf/kvS7WyNATTw/etbZM3R5AAAJ . It will really helpful if you can look into it
On Thu, 5 Sep 2019 at 18:03, Nadav Samet <[email protected]> wrote: > > https://docs.microsoft.com/en-us/dotnet/api/system.bitconverter.tostring?view=netframework-4.8#System_BitConverter_ToString_System_Byte___ > > On Wed, Sep 4, 2019 at 11:17 PM arun kumar <[email protected]> > wrote: > >> I am trying to serialize the data using C# Google protobuf, and I am >> using below code , >> >> private static void printStream(IMessage msg) >> { >> >> >> int size = msg.CalculateSize(); >> byte[] buffer = new byte[size]; >> CodedOutputStream output = new CodedOutputStream(buffer); >> msg.WriteTo(output); >> foreach (byte bb in buffer) >> { >> Console.Write(bb); >> } >> } >> >> JSON of IMessage Object is >> >> { >> "clientIdentifier": { >> "context": "CFID", >> "value": "12340000" >> }, >> "desiredSessionTimeout": "30000" >> } >> >> >> When I print the bytes, I am getting :: >> 1081862151092482117752161762341.. I believe, it is giving dec value >> whereas I am expecting hex value : 0a0a1208313233343030303010b0ea01. >> >> Please help me out , how to get the hex value.. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Protocol Buffers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/protobuf/14bd44ad-10e4-4398-911f-efddad5cbc56%40googlegroups.com >> <https://groups.google.com/d/msgid/protobuf/14bd44ad-10e4-4398-911f-efddad5cbc56%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > -Nadav > -- -- Arun -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/CAG5mLyuwROuJvcSQKrYWVhCjry%3DWEN6u0PZbR0y5%2BJ439drNkA%40mail.gmail.com.
