Apache.NMS.ActiveMQ.OpenWire.BaseDataStreamMarshaller.TightMarshalLong1 C# (CSharp) Method

TightMarshalLong1() public method

public TightMarshalLong1 ( OpenWireFormat wireFormat, long o, BooleanStream bs ) : int
wireFormat OpenWireFormat
o long
bs BooleanStream
return int
        public virtual int TightMarshalLong1(OpenWireFormat wireFormat, long o, BooleanStream bs)
        {
            if (o == 0L)
            {
                bs.WriteBoolean(false);
                bs.WriteBoolean(false);
                return 0;
            }
            else
            {
                ulong ul = (ulong) o;
                if ((ul & 0xFFFFFFFFFFFF0000ul) == 0L)
                {
                    bs.WriteBoolean(false);
                    bs.WriteBoolean(true);
                    return 2;
                }
                else if ((ul & 0xFFFFFFFF00000000ul) == 0L)
                {
                    bs.WriteBoolean(true);
                    bs.WriteBoolean(false);
                    return 4;
                }
                else
                {
                    bs.WriteBoolean(true);
                    bs.WriteBoolean(true);
                    return 8;
                }
            }
        }