Example #1
0
 public static Writer <MemoryBufferWriter> Create(Memory <byte> output, SerializerSession session)
 {
     return(new Writer <MemoryBufferWriter>(new MemoryBufferWriter(output), session));
 }
Example #2
0
 public static Writer <SpanBufferWriter> Create(Span <byte> output, SerializerSession session)
 {
     return(new Writer <SpanBufferWriter>(new SpanBufferWriter(output), output, session));
 }
Example #3
0
 public static Writer <SpanBufferWriter> Create(byte[] output, SerializerSession session)
 {
     return(Create(output.AsSpan(), session));
 }
Example #4
0
 public static Writer <ArrayStreamBufferWriter> Create(Stream destination, SerializerSession session,
                                                       int sizeHint = 0)
 {
     return(new Writer <ArrayStreamBufferWriter>(new ArrayStreamBufferWriter(destination, sizeHint), session));
 }
Example #5
0
 public static Writer <PoolingStreamBufferWriter> CreatePooled(Stream destination, SerializerSession session,
                                                               int sizeHint = 0)
 {
     return(new Writer <PoolingStreamBufferWriter>(new PoolingStreamBufferWriter(destination, sizeHint), session));
 }
Example #6
0
 public static Writer <MemoryStreamBufferWriter> Create(MemoryStream destination, SerializerSession session)
 {
     return(new Writer <MemoryStreamBufferWriter>(new MemoryStreamBufferWriter(destination), session));
 }
Example #7
0
 public static Writer <TBufferWriter> Create <TBufferWriter>(TBufferWriter destination, SerializerSession session)
     where TBufferWriter : IBufferWriter <byte>
 {
     return(new Writer <TBufferWriter>(destination, session));
 }