CSharpRTMP.Common.MediaFile.ReadInt24 C# (CSharp) Method

ReadInt24() public method

public ReadInt24 ( int &result, bool networkOrder = true ) : bool
result int
networkOrder bool
return bool
        public bool ReadInt24(out int result, bool networkOrder = true)
        {
            var buffer = new byte[4];
            if (!ReadBuffer(buffer, 0, 3))
            {
                result = 0;
                return false;
            }
            if (networkOrder)
            {
                result = IPAddress.NetworkToHostOrder(BitConverter.ToInt32(buffer, 0)) >> 8;
            }
            else
            {
                result = BitConverter.ToInt32(buffer, 0);
                result = (result << 8) >> 8;
            }
            return true;
        }