code: public List<StockholmStructure> parse(InputStream inStream, int max) throws IOException {
  		if (max < INFINITY) {
  			throw new IllegalArgumentException("max can't be -ve value " + max);
  		}
  		if (inStream != this.cashedInputStream) {
  			this.cashedInputStream = inStream;
  			this.internalScanner = null;
  		}
  
  		if (internalScanner == null) {
  			internalScanner = new Scanner(inStream);
  		}
  		ArrayList<StockholmStructure> structures = new ArrayList<StockholmStructure>();
  		while (max != INFINITY && max-- > 0) {
  			StockholmStructure structure = parse(internalScanner);
  			if (structure != null) {
  				structures.add(structure);
  			} else {
  				break;
  			}
  		}
  		return structures;
  	}
docs: parses an {@link InputStream} and returns at maximum <code>max</code> objects contained in that file.<br>
  This method leaves the stream open for further calls of {@link #parse(InputStream, int)} (same function) or
  {@link #parseNext(int)}.
  
  @see #parseNext(int)
  @param inStream
  the stream to parse
  @param max
  maximum number of structures to try to parse, {@link #INFINITY} to try to obtain as much as possible.
  @return a {@link List} of {@link StockholmStructure} objects. If there are no more structures, an empty list is
  returned.
  @throws IOException
  in case an I/O Exception occurred.