using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace HH.WMS.Utils.ExcelLibrary.BinaryFileFormat
{
///
/// This record occurs in conjunction with the SST record.
/// Used to optimise string search operations.
///
public partial class EXTSST : Record
{
public EXTSST(Record record) : base(record) { }
public EXTSST()
{
this.Type = RecordType.EXTSST;
this.Offsets = new List();
}
///
/// Number of strings in a portion, this number is >=8
///
public UInt16 NumStrings;
///
/// List of OFFSET structures for all portions.
///
public List Offsets;
public void decode()
{
MemoryStream stream = new MemoryStream(Data);
BinaryReader reader = new BinaryReader(stream);
this.NumStrings = reader.ReadUInt16();
int count = this.NumStrings;
this.Offsets = new List(count);
for (int i = 0; i < count; i++)
{
Offsets.Add(ReadStringOffset(reader));
}
}
public void encode()
{
MemoryStream stream = new MemoryStream();
BinaryWriter writer = new BinaryWriter(stream);
writer.Write(NumStrings);
foreach(StringOffset stringoffsetVar in Offsets)
{
WriteStringOffset(writer, stringoffsetVar);
}
this.Data = stream.ToArray();
this.Size = (UInt16)Data.Length;
base.Encode();
}
}
}