private boolean parseImmediately = true;
+ private boolean dataClosed = false;
+
/**
* @return if doParse() was called at construction time
*/
public AlignFile(boolean parseImmediately, FileParse source)
throws IOException
{
+ this(parseImmediately, source, true);
+ }
+
+ public AlignFile(boolean parseImmediately, FileParse source,
+ boolean closeData) throws IOException
+ {
super(source);
initData();
if (parseImmediately)
{
- doParse();
+ doParse(closeData);
}
}
*/
public void doParse() throws IOException
{
+ doParse(true);
+ }
+
+ public void doParse(boolean closeData) throws IOException
+ {
if (parseCalled)
{
throw new IOException(
}
parseCalled = true;
parse();
- dataIn.close();
+ if (closeData && !dataClosed)
+ {
+ dataIn.close();
+ dataClosed = true;
+ }
}
/**