static private int readBytes ( int c [ ] , int len , InputStream is ) throws IOException { byte buf [ ] = new byte [ len ] ; if ( is . read ( buf , 0 , len ) < len ) { return - 1 ; } // fill the passed in int array for ( int i = 0 ; i < len ; i ++ ) { c [ i ] = buf [ i ] & 0xff ; } return 0 ; }
Tries to read the specified number of bytes from the stream Returns - 1 If EOF is reached before len bytes are read returns 0 otherwise