當前位置: 首頁>>代碼示例>>C#>>正文


C# NetworkBinaryWriter.Write方法代碼示例

本文整理匯總了C#中RabbitMQ.Util.NetworkBinaryWriter.Write方法的典型用法代碼示例。如果您正苦於以下問題:C# NetworkBinaryWriter.Write方法的具體用法?C# NetworkBinaryWriter.Write怎麽用?C# NetworkBinaryWriter.Write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在RabbitMQ.Util.NetworkBinaryWriter的用法示例。


在下文中一共展示了NetworkBinaryWriter.Write方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Write

 public static void Write(NetworkBinaryWriter writer, byte[] source, int offset, int count)
 {
     writer.Write(source, offset, count);
 }
開發者ID:hanxinimm,項目名稱:rabbitmq-dotnet-client,代碼行數:4,代碼來源:BytesWireFormatting.cs

示例2: WriteShort

 public static void WriteShort(NetworkBinaryWriter writer, ushort val)
 {
     writer.Write((ushort)val);
 }
開發者ID:parshim,項目名稱:rabbitmq-dotnet-client,代碼行數:4,代碼來源:WireFormatting.cs

示例3: WriteTable

        ///<summary>Writes an AMQP "table" to the writer.</summary>
        ///<remarks>
        ///<para>
        /// In this method, we assume that the stream that backs our
        /// NetworkBinaryWriter is a positionable stream - which it is
        /// currently (see Frame.m_accumulator, Frame.GetWriter and
        /// Command.Transmit).
        ///</para>
        ///<para>
        /// Supports the AMQP 0-8/0-9 standard entry types S, I, D, T
        /// and F, as well as the QPid-0-8 specific b, d, f, l, s, t
        /// x and V types and the AMQP 0-9-1 A type.
        ///</para>
        ///</remarks>
        public static void WriteTable(NetworkBinaryWriter writer, IDictionary val)
        {
            if (val == null)
            {
                writer.Write((uint)0);
            }
            else
            {
                Stream backingStream = writer.BaseStream;
                long patchPosition = backingStream.Position;
                writer.Write((uint)0); // length of table - will be backpatched

                foreach (DictionaryEntry entry in val)
                {
                    WriteShortstr(writer, (string)entry.Key);
                    object value = entry.Value;
                    WriteFieldValue(writer, value);
                }

                // Now, backpatch the table length.
                long savedPosition = backingStream.Position;
                long tableLength = savedPosition - patchPosition - 4; // offset for length word
                backingStream.Seek(patchPosition, SeekOrigin.Begin);
                writer.Write((uint)tableLength);
                backingStream.Seek(savedPosition, SeekOrigin.Begin);
            }
        }
開發者ID:parshim,項目名稱:rabbitmq-dotnet-client,代碼行數:41,代碼來源:WireFormatting.cs

示例4: WriteLong

 public static void WriteLong(NetworkBinaryWriter writer, uint val)
 {
     writer.Write((uint)val);
 }
開發者ID:parshim,項目名稱:rabbitmq-dotnet-client,代碼行數:4,代碼來源:WireFormatting.cs

示例5: WriteLongstr

 public static void WriteLongstr(NetworkBinaryWriter writer, byte[] val)
 {
     WriteLong(writer, (uint)val.Length);
     writer.Write(val);
 }
開發者ID:parshim,項目名稱:rabbitmq-dotnet-client,代碼行數:5,代碼來源:WireFormatting.cs

示例6: WriteString

 public static void WriteString(NetworkBinaryWriter writer, string value) {
     writer.Write((byte) StreamWireFormattingTag.String);
     WriteUntypedString(writer, value);
 }
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:4,代碼來源:StreamWireFormatting.cs

示例7: WriteArray

 public static void WriteArray(NetworkBinaryWriter writer, IList val)
 {
     if (val == null)
     {
         writer.Write((uint)0);
     }
     else
     {
         Stream backingStream = writer.BaseStream;
         long patchPosition = backingStream.Position;
         writer.Write((uint)0); // length of table - will be backpatched
         foreach (object entry in val)
         {
             WriteFieldValue(writer, entry);
         }
         long savedPosition = backingStream.Position;
         long tableLength = savedPosition - patchPosition - 4; // offset for length word
         backingStream.Seek(patchPosition, SeekOrigin.Begin);
         writer.Write((uint)tableLength);
         backingStream.Seek(savedPosition, SeekOrigin.Begin);
     }
 }
開發者ID:parshim,項目名稱:rabbitmq-dotnet-client,代碼行數:22,代碼來源:WireFormatting.cs

示例8: WriteInt64

 public static void WriteInt64(NetworkBinaryWriter writer, long value)
 {
     writer.Write(value);
 }
開發者ID:hanxinimm,項目名稱:rabbitmq-dotnet-client,代碼行數:4,代碼來源:BytesWireFormatting.cs

示例9: WriteSingle

 public static void WriteSingle(NetworkBinaryWriter writer, float value)
 {
     writer.Write(value);
 }
開發者ID:hanxinimm,項目名稱:rabbitmq-dotnet-client,代碼行數:4,代碼來源:BytesWireFormatting.cs

示例10: WriteInt16

 public static void WriteInt16(NetworkBinaryWriter writer, short value)
 {
     writer.Write(value);
 }
開發者ID:hanxinimm,項目名稱:rabbitmq-dotnet-client,代碼行數:4,代碼來源:BytesWireFormatting.cs

示例11: WriteInt32

 public static void WriteInt32(NetworkBinaryWriter writer, int value)
 {
     writer.Write(value);
 }
開發者ID:hanxinimm,項目名稱:rabbitmq-dotnet-client,代碼行數:4,代碼來源:BytesWireFormatting.cs

示例12: WriteDouble

 public static void WriteDouble(NetworkBinaryWriter writer, double value)
 {
     writer.Write(value);
 }
開發者ID:hanxinimm,項目名稱:rabbitmq-dotnet-client,代碼行數:4,代碼來源:BytesWireFormatting.cs

示例13: WriteChar

 public static void WriteChar(NetworkBinaryWriter writer, char value)
 {
     writer.Write((ushort) value);
 }
開發者ID:hanxinimm,項目名稱:rabbitmq-dotnet-client,代碼行數:4,代碼來源:BytesWireFormatting.cs

示例14: WriteByte

 public static void WriteByte(NetworkBinaryWriter writer, byte value)
 {
     writer.Write(value);
 }
開發者ID:hanxinimm,項目名稱:rabbitmq-dotnet-client,代碼行數:4,代碼來源:BytesWireFormatting.cs

示例15: WriteDouble

 public static void WriteDouble(NetworkBinaryWriter writer, double value) {
     writer.Write((byte) StreamWireFormattingTag.Double);
     writer.Write(value);
 }
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:4,代碼來源:StreamWireFormatting.cs


注:本文中的RabbitMQ.Util.NetworkBinaryWriter.Write方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。