protected void readContents(){
  boolean done=false;
  while (!(done || err())) {
    int code=read();
switch (code) {
case 0x2C:
      readImage();
    break;
case 0x21:
  code=read();
switch (code) {
case 0xf9:
  readGraphicControlExt();
break;
case 0xff:
readBlock();
String app="";
for (int i=0; i < 11; i++) {
app+=(char)block[i];
}
if (app.equals("NETSCAPE2.0")) {
readNetscapeExt();
}
 else skip();
break;
default :
skip();
}
break;
case 0x3b:
done=true;
break;
case 0x00:
break;
default :
status=STATUS_FORMAT_ERROR;
}
}
}

protected void readContents ( ) { boolean done = false ; while ( ! ( done || err ( ) ) ) { int code = read ( ) ; switch ( code ) { case 0x2C : readImage ( ) ; break ; case 0x21 : code = read ( ) ; switch ( code ) { case 0xf9 : readGraphicControlExt ( ) ; break ; case 0xff : readBlock ( ) ; String app = "" ; for ( int i = 0 ; i < 11 ; i ++ ) { app += ( char ) block [ i ] ; } if ( app . equals ( "NETSCAPE2.0" ) ) { readNetscapeExt ( ) ; } else skip ( ) ; break ; default : skip ( ) ; } break ; case 0x3b : done = true ; break ; case 0x00 : break ; default : status = STATUS_FORMAT_ERROR ; } } }
main file parser . reads gif content blocks .
