Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5010

BinaryPrimitives.Read/WriteInt32BigEndian should be used to convert to/from network byte order

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.13.0
    • 0.14.0
    • netstd - Library

    Description

      Conversion should be from/to TCP protocol format (always big-Endian) to execution engine based on processor architecture. See System.BitConverter class ():

      https://docs.microsoft.com/en-us/dotnet/api/system.bitconverter?view=netstandard-2.0

       The endianness of an architecture is indicated by the IsLittleEndian property, which returns true on little-endian systems and false on big-endian systems. On little-endian systems, lower-order bytes precede higher-order bytes. On big-endian system, higher-order bytes precede lower-order bytes. 

      Recomended use BinaryPrimitives.WriteInt32BigEndian/ReadInt32BigEndian class from nuget System.Memory by Microsoft for NetStandard 2.0.

       

      Attachments

        Issue Links

          Activity

            People

              zembord Edward Zhuravlov
              zembord Edward Zhuravlov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Time Spent - 20m Remaining Estimate - 1h 40m
                  1h 40m
                  Logged:
                  Time Spent - 20m Remaining Estimate - 1h 40m
                  20m