src/Orleans.Serialization/Buffers/BufferWriterExtensions.cs
/// <summary>
/// Creates a <see cref="Writer{TBufferWriter}"/> instance for the provided buffer.
/// </summary>
/// <typeparam name="TBufferWriter">The type of the buffer writer.</typeparam>
/// <param name="buffer">The buffer.</param>
/// <param name="session">The session.</param>
/// <returns>A new writer.</returns>
Creates a  instance for the provided buffer.
Creates a instance for the provided buffer .
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static Writer<TBufferWriter> CreateWriter<TBufferWriter>(this TBufferWriter buffer, SerializerSession session) where TBufferWriter : IBufferWriter<byte>
        {
            if (session is null)
            {
                ThrowSessionNull();
            }
            return Writer.Create(buffer, session);
            [MethodImpl(MethodImplOptions.NoInlining)]
            void ThrowSessionNull() => throw new ArgumentNullException(nameof(session));
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] public static Writer < TBufferWriter > CreateWriter < TBufferWriter > ( this TBufferWriter buffer , SerializerSession session ) where TBufferWriter : IBufferWriter < byte > { if ( session is null ) { ThrowSessionNull ( ) ; } return Writer . Create ( buffer , session ) ; [ MethodImpl ( MethodImplOptions . NoInlining ) ] void ThrowSessionNull ( ) => throw new ArgumentNullException ( nameof ( session ) ) ; }
Creates a  instance for the provided buffer.
Creates a instance for the provided buffer .
A new writer.
A new writer .
TBufferWriter
this
session
SerializerSession
None
buffer
None
typeparam
The type of the buffer writer.
The type of the buffer writer .