code: public void decodeHeader() throws IOException {
          if(!headerDecoded) {
              headerDecoded = true;
  
              int m = getMarker();
              if(m != 0xD8) {
                  throw new IOException("no SOI");
              }
              m = getMarker();
              while(m != 0xC0 && m != 0xC1) { // SOF
                  processMarker(m);
                  m = getMarker();
                  while(m == MARKER_NONE) {
                      m = getMarker();
                  }
              }
  
              processSOF();
          }
      }
docs: Decodes the JPEG header. This must be called before the image size can be queried.
  
  @throws IOException if an IO error occurred