コード例 #1
0
ファイル: AmqpValue.cs プロジェクト: toddbaert/amqpnetlite
        int GetCount(byte formatCode, ByteBuffer buffer)
        {
            int count;

            if (formatCode >= 0xA0)
            {
                //bin8  a0 10100001
                //str8  a1 10100001
                //sym8  a3 10100011
                //list8 c0 11000000
                //map8  c1 11000001
                //arr8  e0 11100000
                //bin32 b0 10110000
                //str32 b1 10110001
                //sym32 b3 10110011
                //lit32 d0 11010000
                //map32 d1 11010001
                //arr32 f0 11110000
                if ((formatCode & 0x10) == 0)
                {
                    count = AmqpBitConverter.ReadUByte(buffer);
                }
                else
                {
                    count = AmqpBitConverter.ReadInt(buffer);
                }
            }
            else
            {
                count = (1 << ((formatCode >> 4) - 4)) >> 1;
            }

            return(count);
        }
コード例 #2
0
ファイル: Frame.cs プロジェクト: tralivali1234/IL2JS
        public static Frame Decode(ByteBuffer buffer, bool fullBody = true)
        {
            Frame frame = new Frame();

            frame.RawBuffer = buffer.Array;

            // Header
            frame.size       = (int)AmqpBitConverter.ReadUInt(buffer);
            frame.dataOffset = AmqpBitConverter.ReadUByte(buffer);
            frame.Type       = (FrameType)AmqpBitConverter.ReadUByte(buffer);
            frame.Channel    = AmqpBitConverter.ReadUShort(buffer);
            // skip extended header
            buffer.Complete(frame.dataOffset * 4 - Frame.HeaderSize);

            // Command
            if (buffer.Length > 0)
            {
                frame.Command = (Performative)AmqpCodec.CreateAmqpDescribed(buffer);
                if (fullBody)
                {
                    frame.Command.DecodeValue(buffer);
                }
            }

            return(frame);
        }
コード例 #3
0
        static string ReadString(ByteBuffer buffer, byte formatCode, byte code8, byte code32, string type)
        {
            if (formatCode == FormatCode.Null)
            {
                return(null);
            }

            int count;

            if (formatCode == code8)
            {
                count = AmqpBitConverter.ReadUByte(buffer);
            }
            else if (formatCode == code32)
            {
                count = (int)AmqpBitConverter.ReadUInt(buffer);
            }
            else
            {
                throw DecodeException(formatCode, buffer.Offset);
            }

            buffer.Validate(false, count);
            string value = new string(Encoding.UTF8.GetChars(buffer.Buffer, buffer.Offset, count));

            buffer.Complete(count);

            return(value);
        }
コード例 #4
0
        public static byte[] ReadBinary(ByteBuffer buffer, byte formatCode)
        {
            if (formatCode == FormatCode.Null)
            {
                return(null);
            }

            int count;

            if (formatCode == FormatCode.Binary8)
            {
                count = AmqpBitConverter.ReadUByte(buffer);
            }
            else if (formatCode == FormatCode.Binary32)
            {
                count = (int)AmqpBitConverter.ReadUInt(buffer);
            }
            else
            {
                throw DecodeException(formatCode, buffer.Offset);
            }

            buffer.Validate(false, count);
            byte[] value = new byte[count];
            Array.Copy(buffer.Buffer, buffer.Offset, value, 0, count);
            buffer.Complete(count);

            return(value);
        }
コード例 #5
0
        internal override void DecodeValue(ByteBuffer buffer)
        {
            int  offset     = buffer.Offset;
            byte formatCode = Encoder.ReadFormatCode(buffer);

            if (formatCode == FormatCode.Binary8)
            {
                this.binaryOffset = 2;
            }
            else if (formatCode == FormatCode.Binary32)
            {
                this.binaryOffset = 5;
            }
            else
            {
                while (formatCode == FormatCode.Described)
                {
                    Encoder.ReadObject(buffer);
                    formatCode = Encoder.ReadFormatCode(buffer);
                }
            }

            int count;

            if (formatCode >= 0xA0)
            {
                //bin8  a0 10100001
                //str8  a1 10100001
                //sym8  a3 10100011
                //list8 c0 11000000
                //map8  c1 11000001
                //arr8  e0 11100000
                //bin32 b0 10110000
                //str32 b1 10110001
                //sym32 b3 10110011
                //lit32 d0 11010000
                //map32 d1 11010001
                //arr32 f0 11110000
                if ((formatCode & 0x10) == 0)
                {
                    count = AmqpBitConverter.ReadUByte(buffer);
                }
                else
                {
                    count = AmqpBitConverter.ReadInt(buffer);
                }
            }
            else
            {
                count = (1 << ((formatCode >> 4) - 4)) >> 1;
            }

            buffer.Validate(false, count);
            buffer.Complete(count);

            int size = buffer.Offset - offset;

            this.valueBuffer = new ByteBuffer(buffer.Buffer, offset, size, size);
        }
コード例 #6
0
ファイル: Frame.cs プロジェクト: YunLi1988/ServiceBusFake
 private void DecodeHeader(ByteBuffer buffer)
 {
     this.Size       = (int)AmqpBitConverter.ReadUInt(buffer);
     this.DataOffset = AmqpBitConverter.ReadUByte(buffer);
     this.Type       = (FrameType)AmqpBitConverter.ReadUByte(buffer);
     this.Channel    = AmqpBitConverter.ReadUShort(buffer);
     buffer.Complete(this.DataOffset * 4 - 8);
 }
コード例 #7
0
        public static byte?Decode(ByteBuffer buffer, FormatCode formatCode)
        {
            if (formatCode == 0 && (formatCode = AmqpEncoding.ReadFormatCode(buffer)) == FormatCode.Null)
            {
                return(null);
            }

            return(AmqpBitConverter.ReadUByte(buffer));
        }
コード例 #8
0
ファイル: Frame.cs プロジェクト: xinchen10/azure-amqp
        void DecodeHeader(ByteBuffer buffer)
        {
            this.Size       = (int)AmqpBitConverter.ReadUInt(buffer);
            this.DataOffset = AmqpBitConverter.ReadUByte(buffer);
            this.Type       = (FrameType)AmqpBitConverter.ReadUByte(buffer);
            this.Channel    = AmqpBitConverter.ReadUShort(buffer);

            // skip extended header
            buffer.Complete(this.DataOffset * 4 - Frame.HeaderSize);
        }
コード例 #9
0
 public static byte ReadUByte(ByteBuffer buffer, byte formatCode)
 {
     if (formatCode == FormatCode.UByte)
     {
         return(AmqpBitConverter.ReadUByte(buffer));
     }
     else
     {
         throw DecodeException(formatCode, buffer.Offset);
     }
 }
コード例 #10
0
 public void Decode(ByteBuffer buffer)
 {
     if (buffer.Length < this.EncodeSize)
     {
         throw AmqpEncoding.GetEncodingException(SRAmqp.AmqpInsufficientBufferSize(this.EncodeSize, buffer.Length));
     }
     if (AmqpBitConverter.ReadUInt(buffer) != 1095586128)
     {
         throw AmqpEncoding.GetEncodingException("ProtocolName");
     }
     this.protocolId = (Microsoft.ServiceBus.Messaging.Amqp.ProtocolId)AmqpBitConverter.ReadUByte(buffer);
     this.version    = new AmqpVersion(AmqpBitConverter.ReadUByte(buffer), AmqpBitConverter.ReadUByte(buffer), AmqpBitConverter.ReadUByte(buffer));
 }
コード例 #11
0
ファイル: AmqpCodec.cs プロジェクト: jdaigle/LightRail
        public static AmqpFrame DecodeFrame(ByteBuffer buffer, out ushort channelNumber)
        {
#if DEBUG
            byte[] debugFrameBuffer = new byte[buffer.LengthAvailableToRead];
            Buffer.BlockCopy(buffer.Buffer, buffer.ReadOffset, debugFrameBuffer, 0, buffer.LengthAvailableToRead);
#endif

            int frameStartOffset = buffer.ReadOffset;

            // frame header
            uint frameSize  = AmqpBitConverter.ReadUInt(buffer);
            byte dataOffset = AmqpBitConverter.ReadUByte(buffer);
            byte frameType  = AmqpBitConverter.ReadUByte(buffer);
            channelNumber = AmqpBitConverter.ReadUShort(buffer); // out param

            if (dataOffset < 2)
            {
                throw new AmqpException(ErrorCode.FramingError, $"DOFF must be >= 2. Value is {dataOffset.ToHex()}");
            }

            // data offset is always counted in 4-byte words. header total length is 8 bytes
            int bodyStartOffset = 4 * dataOffset;
            // forward the reader the number of bytes needed to reach the frame body
            buffer.CompleteRead((bodyStartOffset - 8));

            if (frameSize == bodyStartOffset)
            {
                // empty frame body
                return(null);
            }

            // we're expecting a described list...
            var formatCode = DecodeFormatCode(buffer);
            if (formatCode != FormatCode.Described)
            {
                throw new AmqpException(ErrorCode.FramingError, $"Expected Format Code = {FormatCode.Described.ToHex()} but was {formatCode.ToHex()}");
            }

            try
            {
                // decode
                return((AmqpFrame)DecodeDescribedType(buffer, formatCode));
            }
            catch (Exception)
            {
#if DEBUG
                TraceSource.FromClass().Debug(Environment.NewLine + debugFrameBuffer.ToHex());
#endif
                throw;
            }
        }
コード例 #12
0
        static Error ScanDataSection(byte formatCode, ByteBuffer buffer)
        {
            switch (formatCode)
            {
            case FormatCode.Binary8:
                return(AdvanceBuffer(buffer, AmqpBitConverter.ReadUByte(buffer)));

            case FormatCode.Binary32:
                return(AdvanceBuffer(buffer, AmqpBitConverter.ReadUInt(buffer)));

            default:
                return(GetDecodeError(AmqpResources.GetString(Resources.AmqpInvalidFormatCode, formatCode, buffer.Offset)));
            }
        }
コード例 #13
0
ファイル: Frame.cs プロジェクト: vackup/smartcoffee
 public static void Decode(ByteBuffer buffer, out ushort channel, out DescribedList command)
 {
     AmqpBitConverter.ReadUInt(buffer);
     AmqpBitConverter.ReadUByte(buffer);
     AmqpBitConverter.ReadUByte(buffer);
     channel = AmqpBitConverter.ReadUShort(buffer);
     if (buffer.Length > 0)
     {
         command = (DescribedList)Codec.Decode(buffer);
     }
     else
     {
         command = null;
     }
 }
コード例 #14
0
ファイル: AnnotatedMessage.cs プロジェクト: jdaigle/LightRail
        private static void SkipBinaryBuffer(ByteBuffer buffer)
        {
            var binaryFormatCode = AmqpCodec.DecodeFormatCode(buffer);
            int size             = 0;

            if (binaryFormatCode == FormatCode.Binary8)
            {
                size = AmqpBitConverter.ReadUByte(buffer);
            }
            else if (binaryFormatCode == FormatCode.Binary32)
            {
                size = (int)AmqpBitConverter.ReadUInt(buffer);
            }
            buffer.CompleteRead(size);
        }
コード例 #15
0
        bool OnFrame(Stream stream, ByteBuffer buffer)
        {
            buffer.Complete(1);
            byte          type    = AmqpBitConverter.ReadUByte(buffer);
            ushort        channel = AmqpBitConverter.ReadUShort(buffer);
            DescribedList command = (DescribedList)Encoder.ReadDescribed(buffer, Encoder.ReadFormatCode(buffer));

            Amqp.Message message = null;
            if (command.Descriptor.Code == FrameCodes.TRANSFER)
            {
                message = Amqp.Message.Decode(buffer);
            }

            return(testAmqpPeer.OnFrame(stream, channel, command, message));
        }
コード例 #16
0
        public static bool?Decode(ByteBuffer buffer, FormatCode formatCode)
        {
            if (formatCode == 0 && (formatCode = AmqpEncoding.ReadFormatCode(buffer)) == FormatCode.Null)
            {
                return(null);
            }

            VerifyFormatCode(formatCode, buffer.Offset, FormatCode.Boolean, FormatCode.BooleanFalse, FormatCode.BooleanTrue);
            if (formatCode == FormatCode.Boolean)
            {
                return(AmqpBitConverter.ReadUByte(buffer) != 0);
            }
            else
            {
                return(formatCode == FormatCode.BooleanTrue ? true : false);
            }
        }
コード例 #17
0
ファイル: DescribedList.cs プロジェクト: jdaigle/LightRail
        protected override void DecodeValue(ByteBuffer buffer)
        {
            var formatCode = AmqpCodec.DecodeFormatCode(buffer);

            if (formatCode == FormatCode.Null)
            {
                return; // nothing to decode
            }

            int size;
            int count;

            if (formatCode == FormatCode.List0)
            {
                size = count = 0;
            }
            else if (formatCode == FormatCode.List8)
            {
                size  = AmqpBitConverter.ReadUByte(buffer);
                count = AmqpBitConverter.ReadUByte(buffer);
            }
            else if (formatCode == FormatCode.List32)
            {
                size  = (int)AmqpBitConverter.ReadUInt(buffer);
                count = (int)AmqpBitConverter.ReadUInt(buffer);
            }
            else
            {
                throw new AmqpException(ErrorCode.DecodeError, $"The format code '{formatCode}' at frame buffer offset '{buffer.ReadOffset}' is invalid.");
            }

            var thisType = GetType();

            for (int i = 0; i < count; i++)
            {
                var itemFormatCode = AmqpCodec.DecodeFormatCode(buffer);
                if (itemFormatCode == FormatCode.Null)
                {
                    continue; // null value, ignore and continue
                }
                GetDecoderDelegate(thisType, i)(this, buffer, itemFormatCode);
            }
        }
コード例 #18
0
 public static ulong ReadULong(ByteBuffer buffer, byte formatCode)
 {
     if (formatCode == FormatCode.ULong0)
     {
         return(0);
     }
     else if (formatCode == FormatCode.SmallULong)
     {
         return(AmqpBitConverter.ReadUByte(buffer));
     }
     else if (formatCode == FormatCode.ULong)
     {
         return(AmqpBitConverter.ReadULong(buffer));
     }
     else
     {
         throw DecodeException(formatCode, buffer.Offset);
     }
 }
コード例 #19
0
 public static uint ReadUInt(ByteBuffer buffer, byte formatCode)
 {
     if (formatCode == FormatCode.UInt0)
     {
         return(0);
     }
     else if (formatCode == FormatCode.SmallUInt)
     {
         return(AmqpBitConverter.ReadUByte(buffer));
     }
     else if (formatCode == FormatCode.UInt)
     {
         return(AmqpBitConverter.ReadUInt(buffer));
     }
     else
     {
         throw DecodeException(formatCode, buffer.Offset);
     }
 }
コード例 #20
0
        public static Array ReadArray(ByteBuffer buffer, byte formatCode)
        {
            if (formatCode == FormatCode.Null)
            {
                return(null);
            }

            int size;
            int count;

            if (formatCode == FormatCode.Array8)
            {
                size  = AmqpBitConverter.ReadUByte(buffer);
                count = AmqpBitConverter.ReadUByte(buffer);
            }
            else if (formatCode == FormatCode.Array32)
            {
                size  = (int)AmqpBitConverter.ReadUInt(buffer);
                count = (int)AmqpBitConverter.ReadUInt(buffer);
            }
            else
            {
                throw DecodeException(formatCode, buffer.Offset);
            }

            formatCode = Encoder.ReadFormatCode(buffer);
            Serializer codec = GetSerializer(formatCode);

            if (codec == null)
            {
                throw DecodeException(formatCode, buffer.Offset);
            }

            Array value = Array.CreateInstance(codec.Type, count);
            IList list  = value;

            for (int i = 0; i < count; ++i)
            {
                list[i] = codec.Decoder(buffer, formatCode);
            }

            return(value);
        }
コード例 #21
0
ファイル: ULongEncoding.cs プロジェクト: xinchen10/azure-amqp
        public static ulong?Decode(ByteBuffer buffer, FormatCode formatCode)
        {
            if (formatCode == 0 && (formatCode = AmqpEncoding.ReadFormatCode(buffer)) == FormatCode.Null)
            {
                return(null);
            }

            VerifyFormatCode(formatCode, buffer.Offset, FormatCode.ULong, FormatCode.SmallULong, FormatCode.ULong0);
            if (formatCode == FormatCode.ULong0)
            {
                return(0);
            }
            else
            {
                return(formatCode == FormatCode.SmallULong ?
                       AmqpBitConverter.ReadUByte(buffer) :
                       AmqpBitConverter.ReadULong(buffer));
            }
        }
コード例 #22
0
ファイル: AnnotatedMessage.cs プロジェクト: jdaigle/LightRail
        private static void SkipDescribedList(ByteBuffer buffer)
        {
            // read the list length and move forward
            var listFormatCode = AmqpCodec.DecodeFormatCode(buffer);
            int size           = 0;

            if (listFormatCode == FormatCode.List0)
            {
                size = 0;
            }
            else if (listFormatCode == FormatCode.List8)
            {
                size = AmqpBitConverter.ReadUByte(buffer);
            }
            else if (listFormatCode == FormatCode.List32)
            {
                size = (int)AmqpBitConverter.ReadUInt(buffer);
            }
            buffer.CompleteRead(size);
        }
コード例 #23
0
 public static bool ReadBoolean(ByteBuffer buffer, byte formatCode)
 {
     if (formatCode == FormatCode.BooleanTrue)
     {
         return(true);
     }
     else if (formatCode == FormatCode.BooleanFalse)
     {
         return(false);
     }
     else if (formatCode == FormatCode.Boolean)
     {
         byte data = AmqpBitConverter.ReadUByte(buffer);
         return(data != 0);
     }
     else
     {
         throw DecodeException(formatCode, buffer.Offset);
     }
 }
コード例 #24
0
ファイル: ProtocolHeader.cs プロジェクト: yvgopal/azure-amqp
        public void Decode(ByteBuffer buffer)
        {
            if (buffer.Length < this.EncodeSize)
            {
                throw new AmqpException(AmqpErrorCode.DecodeError, AmqpResources.GetString(AmqpResources.AmqpInsufficientBufferSize, this.EncodeSize, buffer.Length));
            }

            uint prefix = AmqpBitConverter.ReadUInt(buffer);

            if (prefix != ProtocolHeader.AmqpPrefix)
            {
                throw new AmqpException(AmqpErrorCode.DecodeError, "ProtocolName" + prefix.ToString("X8"));
            }

            this.protocolId = (ProtocolId)AmqpBitConverter.ReadUByte(buffer);

            this.version = new AmqpVersion(
                AmqpBitConverter.ReadUByte(buffer),
                AmqpBitConverter.ReadUByte(buffer),
                AmqpBitConverter.ReadUByte(buffer));
        }
コード例 #25
0
ファイル: ProtocolHeader.cs プロジェクト: tralivali1234/IL2JS
        public static ProtocolHeader Decode(ByteBuffer buffer)
        {
            if (buffer.Length < ProtocolHeader.Size)
            {
                throw AmqpEncoding.GetEncodingException("BufferSize");
            }

            uint prefix = AmqpBitConverter.ReadUInt(buffer);

            if (prefix != ProtocolHeader.AmqpPrefix)
            {
                throw AmqpEncoding.GetEncodingException("ProtocolName");
            }

            ProtocolHeader header = new ProtocolHeader();

            header.protocolId = (ProtocolId)AmqpBitConverter.ReadUByte(buffer);
            header.version    = new AmqpVersion(AmqpBitConverter.ReadUByte(buffer), AmqpBitConverter.ReadUByte(buffer), AmqpBitConverter.ReadUByte(buffer));
            header.Buffer     = new ArraySegment <byte>(buffer.Buffer, buffer.Offset - ProtocolHeader.Size, ProtocolHeader.Size);
            return(header);
        }
コード例 #26
0
        public static Map ReadMap(ByteBuffer buffer, byte formatCode)
        {
            if (formatCode == FormatCode.Null)
            {
                return(null);
            }

            int size;
            int count;

            if (formatCode == FormatCode.Map8)
            {
                size  = AmqpBitConverter.ReadUByte(buffer);
                count = AmqpBitConverter.ReadUByte(buffer);
            }
            else if (formatCode == FormatCode.Map32)
            {
                size  = (int)AmqpBitConverter.ReadUInt(buffer);
                count = (int)AmqpBitConverter.ReadUInt(buffer);
            }
            else
            {
                throw DecodeException(formatCode, buffer.Offset);
            }

            if (count % 2 > 0)
            {
                throw new AmqpException(ErrorCode.DecodeError,
                                        Fx.Format(SRAmqp.InvalidMapCount, count));
            }

            Map value = new Map();

            for (int i = 0; i < count; i += 2)
            {
                value.Add(ReadObject(buffer), ReadObject(buffer));
            }

            return(value);
        }
コード例 #27
0
        public static List ReadList(ByteBuffer buffer, byte formatCode)
        {
            if (formatCode == FormatCode.Null)
            {
                return(null);
            }

            int size;
            int count;

            if (formatCode == FormatCode.List0)
            {
                size = count = 0;
            }
            else if (formatCode == FormatCode.List8)
            {
                size  = AmqpBitConverter.ReadUByte(buffer);
                count = AmqpBitConverter.ReadUByte(buffer);
            }
            else if (formatCode == FormatCode.List32)
            {
                size  = (int)AmqpBitConverter.ReadUInt(buffer);
                count = (int)AmqpBitConverter.ReadUInt(buffer);
            }
            else
            {
                throw DecodeException(formatCode, buffer.Offset);
            }

            List value = new List();

            for (int i = 0; i < count; ++i)
            {
                value.Add(ReadObject(buffer));
            }

            return(value);
        }
コード例 #28
0
 protected static void ReadSizeAndCount(ByteBuffer buffer, byte formatCode, out int size, out int count, out int width)
 {
     if (formatCode == FormatCode.List0)
     {
         size = count = width = 0;
     }
     else if (formatCode == FormatCode.List8 || formatCode == FormatCode.Map8)
     {
         width = FixedWidth.UByte;
         size  = AmqpBitConverter.ReadUByte(buffer);
         count = AmqpBitConverter.ReadUByte(buffer);
     }
     else if (formatCode == FormatCode.List32 || formatCode == FormatCode.Map32)
     {
         width = FixedWidth.UInt;
         size  = (int)AmqpBitConverter.ReadUInt(buffer);
         count = (int)AmqpBitConverter.ReadUInt(buffer);
     }
     else
     {
         throw new AmqpException(ErrorCode.InvalidField, Fx.Format(SRAmqp.AmqpInvalidFormatCode, formatCode, buffer.Offset));
     }
 }
コード例 #29
0
        static Error ScanValueSection(byte formatCode, ByteBuffer buffer, int depth = 0)
        {
            if (formatCode == FormatCode.Described)
            {
                if (depth > 10)
                {
                    // protection for stack overflow
                    return(GetDecodeError(AmqpResources.GetString(Resources.AmqpInvalidFormatCode, formatCode, buffer.Offset)));
                }

                Error error = ScanValueSection(AmqpEncoding.ReadFormatCode(buffer), buffer, depth + 1);
                if (error != null)
                {
                    return(error);
                }

                formatCode = AmqpEncoding.ReadFormatCode(buffer);
            }

            uint size;

            if (formatCode >= FormatCode.Binary8)
            {
                // variable width
                size = (formatCode & 0x10) == 0 ?
                       AmqpBitConverter.ReadUByte(buffer) :
                       AmqpBitConverter.ReadUInt(buffer);
            }
            else
            {
                // fixed width
                size = (uint)((1 << ((formatCode >> 4) - 4)) >> 1);
            }

            return(AdvanceBuffer(buffer, size));
        }
コード例 #30
0
        public void TestMethod_AmqpBitConverter()
        {
            ByteBuffer buffer = new ByteBuffer(128, true);

            AmqpBitConverter.WriteByte(buffer, 0x22);
            AmqpBitConverter.WriteByte(buffer, -0x22);

            AmqpBitConverter.WriteUByte(buffer, 0x22);
            AmqpBitConverter.WriteUByte(buffer, 0xB2);

            AmqpBitConverter.WriteShort(buffer, 0x22B7);
            AmqpBitConverter.WriteShort(buffer, -0x22B7);

            AmqpBitConverter.WriteUShort(buffer, 0x22B7);
            AmqpBitConverter.WriteUShort(buffer, 0xC2B7);

            AmqpBitConverter.WriteInt(buffer, 0x340da287);
            AmqpBitConverter.WriteInt(buffer, -0x340da287);

            AmqpBitConverter.WriteUInt(buffer, 0x340da287);
            AmqpBitConverter.WriteUInt(buffer, 0xF40da287);

            AmqpBitConverter.WriteLong(buffer, 0x5d00BB9A340da287);
            AmqpBitConverter.WriteLong(buffer, -0x5d00BB9A340da287);

            AmqpBitConverter.WriteULong(buffer, 0x5d00BB9A340da287);
            AmqpBitConverter.WriteULong(buffer, 0xad00BB9A340da287);

            AmqpBitConverter.WriteFloat(buffer, 12344.4434F);
            AmqpBitConverter.WriteFloat(buffer, -12344.4434F);

            AmqpBitConverter.WriteDouble(buffer, 39432123244.44352334);
            AmqpBitConverter.WriteDouble(buffer, -39432123244.44352334);

            Guid uuid = Guid.NewGuid();

            AmqpBitConverter.WriteUuid(buffer, uuid);

            sbyte b  = AmqpBitConverter.ReadByte(buffer);
            sbyte b2 = AmqpBitConverter.ReadByte(buffer);

            byte ub  = AmqpBitConverter.ReadUByte(buffer);
            byte ub2 = AmqpBitConverter.ReadUByte(buffer);

            short s  = AmqpBitConverter.ReadShort(buffer);
            short s2 = AmqpBitConverter.ReadShort(buffer);

            ushort us  = AmqpBitConverter.ReadUShort(buffer);
            ushort us2 = AmqpBitConverter.ReadUShort(buffer);

            int i  = AmqpBitConverter.ReadInt(buffer);
            int i2 = AmqpBitConverter.ReadInt(buffer);

            uint ui  = AmqpBitConverter.ReadUInt(buffer);
            uint ui2 = AmqpBitConverter.ReadUInt(buffer);

            long l  = AmqpBitConverter.ReadLong(buffer);
            long l2 = AmqpBitConverter.ReadLong(buffer);

            ulong ul  = AmqpBitConverter.ReadULong(buffer);
            ulong ul2 = AmqpBitConverter.ReadULong(buffer);

            float f  = AmqpBitConverter.ReadFloat(buffer);
            float f2 = AmqpBitConverter.ReadFloat(buffer);

            double d  = AmqpBitConverter.ReadDouble(buffer);
            double d2 = AmqpBitConverter.ReadDouble(buffer);

            Guid uuid2 = AmqpBitConverter.ReadUuid(buffer);
        }