question: protected int [ ] readColorTable ( int ncolors ) { int nbytes = 3 * ncolors ; int [ ] tab = null ; byte [ ] c = new byte [ nbytes ] ; int n = 0 ; try { n = in . read ( c ) ; } catch ( IOException e ) { } if ( n < nbytes ) { status = STATUS_FORMAT_ERROR ; } else { tab = new int [ 256 ] ; int i = 0 ; int j = 0 ; while ( i < ncolors ) { int r = c [ j ++ ] & 0xff ; int g = c [ j ++ ] & 0xff ; int b = c [ j ++ ] & 0xff ; tab [ i ++ ] = 0xff000000 | ( r << 16 ) | ( g << 8 ) | b ; } } return tab ; }
target:  Reads color table as 256 RGB integer values