コード例 #1
0
        public static List <string> ReadStringOffsetTable(this BinaryStream stream, StringCodec codec,
                                                          bool isScript, bool multiplyByTwo, int dataPointer)
        {
            var strings = new List <string>();

            var offsetReader = new ShortOffsetTableReader(stream, dataPointer, multiplyByTwo);

            while (!offsetReader.EndOfTable)
            {
                if (offsetReader.Next())
                {
                    strings.Add(isScript ? codec.ReadScriptString(stream) : codec.ReadCodedString(stream));
                }
                else
                {
                    strings.Add(null);
                }
            }

            return(strings);
        }
コード例 #2
0
        public static List <string> ReadStringOffsetTable(this WideOffsetTableReader offsetTableReader, StringCodec codec,
                                                          bool isScript, bool multiplyByTwo)
        {
            int offsetPointer = offsetTableReader.NextPointer();
            int dataPointer   = offsetTableReader.NextPointer();
            var stream        = offsetTableReader.Stream;

            if (offsetPointer != 0 && dataPointer != 0)
            {
                stream.Position = offsetPointer;
                return(stream.ReadStringOffsetTable(codec, isScript, multiplyByTwo, dataPointer));
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
 public static StringTable ReadStringTable(this WideOffsetTableReader offsetTableReader, StringCodec codec)
 {
     offsetTableReader.Next();
     return(offsetTableReader.Stream.ReadStringTable(codec));
 }