internal static void SortTable(MetaDataTableVM mdTblVM, uint rid, uint count, string descr) { var doc = mdTblVM.Document; int len = (int)count * mdTblVM.TableInfo.RowSize; var data = new byte[len]; ulong startOffset = mdTblVM.StartOffset + (rid - 1) * (ulong)mdTblVM.TableInfo.RowSize; doc.Read(startOffset, data, 0, data.Length); TableSorter.Sort(mdTblVM.TableInfo, data); WriteHexUndoCommand.AddAndExecute(doc, startOffset, data, descr); }
internal static void SortTable(MetaDataTableVM mdTblVM, uint rid, uint count) { var buffer = mdTblVM.Buffer; int len = (int)count * mdTblVM.TableInfo.RowSize; var data = new byte[len]; var startOffset = mdTblVM.Span.Start + (rid - 1) * (ulong)mdTblVM.TableInfo.RowSize; buffer.ReadBytes(startOffset, data); TableSorter.Sort(mdTblVM.TableInfo, data); HexBufferWriterHelper.Write(buffer, startOffset, data); }