// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
return _zipped_inputstream;
}
+ @Override
public Phylogeny[] parse() throws IOException, PhylogenyParserException {
reset();
final PhyloXmlHandler handler = new PhyloXmlHandler();
else if ( getSource() instanceof InputStream ) {
if ( !isZippedInputstream() ) {
final InputStream is = ( InputStream ) getSource();
- final Reader reader = new InputStreamReader( is );
- xml_reader.parse( new InputSource( reader ) );
+ xml_reader.parse( new InputSource( new InputStreamReader( is ) ) );
}
else {
final ZipInputStream zip_is = new ZipInputStream( ( InputStream ) getSource() );
zip_is.getNextEntry();
- final Reader reader = new InputStreamReader( zip_is );
- if ( reader == null ) {
- throw new PhylogenyParserException( "zip input stream \"" + getSource()
- + "\" appears not to contain any (phyloXML) data" );
- }
- xml_reader.parse( new InputSource( reader ) );
+ xml_reader.parse( new InputSource( new InputStreamReader( zip_is ) ) );
}
}
else if ( getSource() instanceof String ) {
_warning_messages = new StringBuffer();
}
+ @Override
public void setSource( final Object source ) {
_source = source;
}