public void SetSource(NetDataWriter dataWriter) { _data = dataWriter.Data; _position = 0; _dataSize = dataWriter.Length; }
/// <summary> /// Serialize struct to NetDataWriter (fast) /// </summary> /// <param name="writer">Serialization target NetDataWriter</param> /// <param name="obj">Object to serialize</param> /// <exception cref="InvalidTypeException"><typeparamref name="T"/>'s fields are not supported, or it has no fields</exception> public void Serialize <T>(NetDataWriter writer, T obj) where T : class, new() { RegisterInternal <T>().Write(writer, obj); }