Ejemplo n.º 1
0
        public static IOwnedBuffer <byte> SerializeUnsafe <T>(T obj)
        {
            var output = new LZ4ThreadLocalBufferWriter();

            Serialize(output, obj, null);
            return(output.OwnedWrittenBuffer);
        }
Ejemplo n.º 2
0
        public static IOwnedBuffer <byte> SerializeUnsafe <T>(T obj, IFormatterResolver resolver)
        {
            var output = new LZ4ThreadLocalBufferWriter();

            Serialize(output, obj, resolver);
            return(output.OwnedWrittenBuffer);
        }
Ejemplo n.º 3
0
 public static byte[] Serialize <T>(T obj, IFormatterResolver resolver)
 {
     using (var output = new LZ4ThreadLocalBufferWriter())
     {
         Serialize(output, obj, resolver);
         return(output.ToArray());
     }
 }