Ejemplo n.º 1
0
        public static NetDataWriter FromBytes(byte[] bytes, int offset, int length)
        {
            var netDataWriter = new NetDataWriter(true, bytes.Length);

            netDataWriter.WriteOnlyData(bytes, offset, length);
            return(netDataWriter);
        }
Ejemplo n.º 2
0
 public static NetDataWriter FromBytes(byte[] bytes, bool copy)
 {
     if (copy)
     {
         var netDataWriter = new NetDataWriter(true, bytes.Length);
         netDataWriter.WriteOnlyData(bytes);
         return(netDataWriter);
     }
     return(new NetDataWriter(true, 0)
     {
         _data = bytes
     });
 }