当前位置: 首页>>代码示例>>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;未经允许,请勿转载。