public static final void readFully(InputStream is,byte[] buffer,int offset,int len) throws IOException {
  int temp;
  while (len > 0) {
    temp=is.read(buffer,offset,len);
    if (temp == -1)     throw new EOFException("Cannot read all " + len + " bytes needed to form this token!");
    offset+=temp;
    len-=temp;
  }
}

public static final void readFully ( InputStream is , byte [ ] buffer , int offset , int len ) throws IOException { int temp ; while ( len > 0 ) { temp = is . read ( buffer , offset , len ) ; if ( temp == - 1 ) throw new EOFException ( "Cannot read all " + len + " bytes needed to form this token!" ) ; offset += temp ; len -= temp ; } }
blocks till the required number of bytes have been read from the input stream .
