public static ExternalSortable[] readArrayOfExternalSortable(InputStream in,ExternalSortable ex) throws IOException {
  Vector A=new Vector();
  int i=0;
  try {
    do {
      A.addElement(ex.read(in));
      i++;
    }
 while (true);
  }
 catch (  IOException e) {
  }
  ExternalSortable[] eA=new ExternalSortable[i];
  for (int j=0; j < i; j++)   eA[j]=(ExternalSortable)A.elementAt(j);
  return eA;
}

public static ExternalSortable [ ] readArrayOfExternalSortable ( InputStream in , ExternalSortable ex ) throws IOException { Vector A = new Vector ( ) ; int i = 0 ; try { do { A . addElement ( ex . read ( in ) ) ; i ++ ; } while ( true ) ; } catch ( IOException e ) { } ExternalSortable [ ] eA = new ExternalSortable [ i ] ; for ( int j = 0 ; j < i ; j ++ ) eA [ j ] = ( ExternalSortable ) A . elementAt ( j ) ; return eA ; }
reads in as many externalsortables as it can and returns an array corresponding to the externalsortables . input : in should contain some sequence of externalsortables , otherwise a runtimeexception is thrown
