Пример #1
0
 public GAT(byte[] data)
 {
     try
     {
         using (System.IO.MemoryStream ms = new System.IO.MemoryStream(data, 0, data.Length))
         {
             using (System.IO.BinaryReader br = new System.IO.BinaryReader(ms))
             {
                 m_Magic    = System.Text.Encoding.Default.GetString(br.ReadBytes(4));
                 m_VerMajor = br.ReadByte();
                 m_VerMinor = br.ReadByte();
                 m_Width    = br.ReadInt32();
                 m_Height   = br.ReadInt32();
                 m_Cells    = new GATCell[m_Width * m_Height + 1];
                 for (int i = 0; i <= m_Width * m_Height - 1; i++)
                 {
                     m_Cells[i] = new GATCell(br);
                 }
             }
         }
     }
     catch
     {
         throw;
     }
 }
Пример #2
0
 public GAT(byte[] data)
 {
     try
     {
         using (System.IO.MemoryStream ms = new System.IO.MemoryStream(data, 0, data.Length))
         {
             using (System.IO.BinaryReader br = new System.IO.BinaryReader(ms))
             {
                 m_Magic = System.Text.Encoding.Default.GetString(br.ReadBytes(4));
                 m_VerMajor = br.ReadByte();
                 m_VerMinor = br.ReadByte();
                 m_Width = br.ReadInt32();
                 m_Height = br.ReadInt32();
                 m_Cells = new GATCell[m_Width * m_Height + 1];
                 for (int i = 0; i <= m_Width * m_Height - 1; i++)
                 {
                     m_Cells[i] = new GATCell(br);
                 }
             }
         }
     }
     catch
     {
         throw;
     }
 }