ExtSSt.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Runtime.InteropServices;
  5. using Biff8Excel.Interfaces;
  6. namespace Biff8Excel.Records
  7. {
  8. ////SST校验
  9. //[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
  10. //struct sExtSSt
  11. //{
  12. // public ushort opcode; // 0xFF
  13. // public ushort length;
  14. // public ushort npoint; // >=8 每隔多少非重复校验一次(至少为8)
  15. //}
  16. //internal class ExtSSt : IRecords
  17. //{
  18. // sExtSSt extsst;
  19. // int m_absolut;
  20. // ushort[] relativePoints;
  21. // public ExtSSt()
  22. // {
  23. // extsst.opcode = 0xFF;
  24. // extsst.npoint = Globals.npoint;
  25. // }
  26. // //绝对偏移量
  27. // public int absolutoffset
  28. // {
  29. // set { m_absolut = value; }
  30. // }
  31. // public ushort[] relaPoint
  32. // {
  33. // set { relativePoints = value; }
  34. // }
  35. // #region IRecords 成员
  36. // public byte[] GetByte()
  37. // {
  38. // int len = (relativePoints.Length ) * 8 + 2;
  39. // uint absolutPoint = 0; // 所在的数据长度的绝对位置
  40. // //ushort relativePoint = 0; // 相对SST数据长度的相对位置
  41. // //public ushort noUsed; // 0x0;
  42. // extsst.length = (ushort)len;
  43. // byte[] b = new byte[len+4];
  44. // Globals.GetByte(extsst).CopyTo(b, 0);
  45. // if (relativePoints.Length > 0)
  46. // {
  47. // int pos = 6;
  48. // for (int i = 0; i < relativePoints.Length; i++)
  49. // {
  50. // absolutPoint = (uint)(m_absolut + relativePoints[i]);
  51. // BitConverter.GetBytes(absolutPoint).CopyTo(b, pos);
  52. // pos += 4;
  53. // BitConverter.GetBytes(relativePoints[i]).CopyTo(b, pos);
  54. // pos += 4;
  55. // }
  56. // }
  57. // return b;
  58. // }
  59. // #endregion
  60. //}
  61. }