Пример #1
0
        /// <summary>
        /// Writes a length (in bytes) for length-delimited data.
        /// </summary>
        /// <remarks>
        /// This method simply writes a rawint, but exists for clarity in calling code.
        /// </remarks>
        /// <param name="length">Length value, in bytes.</param>
        public void WriteLength(int length)
        {
            var span = new Span <byte>(buffer);

            WritingPrimitives.WriteLength(ref span, ref state, length);
        }
Пример #2
0
 public static void WriteMessage(ref WriteContext ctx, IMessage value)
 {
     WritingPrimitives.WriteLength(ref ctx.buffer, ref ctx.state, value.CalculateSize());
     WriteRawMessage(ref ctx, value);
 }
Пример #3
0
 /// <summary>
 /// Writes a length (in bytes) for length-delimited data.
 /// </summary>
 /// <remarks>
 /// This method simply writes a rawint, but exists for clarity in calling code.
 /// </remarks>
 /// <param name="length">Length value, in bytes.</param>
 public void WriteLength(int length)
 {
     WritingPrimitives.WriteLength(ref buffer, ref state, length);
 }