/// <summary> /// DataTable拆包 /// </summary> /// <param name="value"></param> /// <returns></returns> public unsafe static DataTable Get(dataTable value) { if (value == null) { return(null); } DataTable table = new DataTable(value.name); try { if (value.rowCount != 0) { fixed(byte *dataFixed = value.data.Data) { dataReader builder = new dataReader(dataFixed, value.data.Strings, value.data.Bytes); value.get(table, builder); } } return(table); } catch (Exception error) { table.Dispose(); log.Error.Add(error, null, false); } return(null); }
/// <summary> /// DataTable包装 /// </summary> /// <param name="table"></param> /// <param name="builder">数据流包装器</param> /// <returns></returns> internal static dataTable From(DataTable table, dataWriter builder) { dataTable value = new dataTable(); if ((value.rowCount = table.Rows.Count) != 0) { value.from(table, builder); } value.name = table.TableName; return(value); }
/// <summary> /// DataTable包装 /// </summary> /// <param name="table"></param> /// <returns></returns> public static dataTable From(DataTable table) { if (table == null) { return(null); } dataTable value = new dataTable(); if ((value.rowCount = table.Rows.Count) != 0) { using (dataWriter builder = new dataWriter()) { value.from(table, builder); value.data = builder.Get(); } } return(value); }
public static DataTable DeSerialize(byte[] data) { dataTable value = fastCSharp.emit.dataDeSerializer.DeSerialize <dataTable>(data); return(value != null?Get(value) : null); }