Exemple #1
0
 public PM1ElementFileNames(BinaryReader reader, PM1Table.Element element)
 {
     List.Clear();
     _Size = element.Size;
     reader.BaseStream.Position = element.Position;
     for (int i = 0; i < element.Count; i++)
     {
         List.Add(Encoding.ASCII.GetString(reader.ReadBytes(element.Size).Where(x => x != 0).ToArray()));
     }
 }
Exemple #2
0
 public PM1ElementRMDHead(BinaryReader reader, PM1Table.Element element)
 {
     List.Clear();
     _Size = element.Size;
     reader.BaseStream.Position = element.Position;
     for (int i = 0; i < element.Count; i++)
     {
         List.Add(new Structure(reader));
     }
 }
 public PM1Element(BinaryReader reader, PM1Table.Element element)
 {
     _Size = element.Size;
     _Type = (TypeMap)element.Index;
     reader.BaseStream.Position = element.Position;
     for (int i = 0; i < element.Count; i++)
     {
         List.Add(reader.ReadBytes(element.Size));
     }
 }
        public PM1ElementEPL(BinaryReader reader, PM1Table.Element element, PM1ElementEPLHead headers)
        {
            reader.BaseStream.Position = element.Position;
            using (BinaryReader temp = new BinaryReader(new MemoryStream(reader.ReadBytes(element.Size))))
            {
                var pos = headers.List.Select(x => x.Position - headers.List.First().Position).ToList();
                pos.Add((int)temp.BaseStream.Length);

                for (int i = 0; i < pos.Count - 1; i++)
                {
                    List.Add(temp.ReadBytes(pos[i + 1] - pos[i]));
                }
            }
        }
        // public MemoryStream BMD { get; set; } = new MemoryStream();

        public PM1ElementBMD(BinaryReader reader, PM1Table.Element element)
        {
            reader.BaseStream.Position = element.Position;
            BMD = reader.ReadBytes(element.Size);
        }