code: protected void readHeader() throws IOException {
          StringBuilder id = new StringBuilder(8);
          for (int i = 0; i < 6; i++) {
              id.append((char)in.read());
          }
          if (!id.toString().startsWith("GIF8")) {
              throw new IOException("Gif signature nor found.");
          }
          
          readLSD();
          if (gctFlag) {
              m_global_table = readColorTable(m_gbpc);
          }
      }
docs: Reads GIF file header information.