git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3703 fix Gff3 shared InputStream with embedded FASTA data
[jalview.git]
/
src
/
jalview
/
io
/
AlignFile.java
diff --git
a/src/jalview/io/AlignFile.java
b/src/jalview/io/AlignFile.java
index
338c4b2
..
b30fe33
100755
(executable)
--- a/
src/jalview/io/AlignFile.java
+++ b/
src/jalview/io/AlignFile.java
@@
-79,6
+79,8
@@
public abstract class AlignFile extends FileParse
private boolean parseImmediately = true;
private boolean parseImmediately = true;
+ private boolean dataClosed = false;
+
/**
* @return if doParse() was called at construction time
*/
/**
* @return if doParse() was called at construction time
*/
@@
-164,6
+166,12
@@
public abstract class AlignFile extends FileParse
public AlignFile(boolean parseImmediately, FileParse source)
throws IOException
{
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();
super(source);
initData();
@@
-173,7
+181,7
@@
public abstract class AlignFile extends FileParse
if (parseImmediately)
{
if (parseImmediately)
{
- doParse();
+ doParse(closeData);
}
}
}
}
@@
-184,6
+192,11
@@
public abstract class AlignFile extends FileParse
*/
public void doParse() throws IOException
{
*/
public void doParse() throws IOException
{
+ doParse(true);
+ }
+
+ public void doParse(boolean closeData) throws IOException
+ {
if (parseCalled)
{
throw new IOException(
if (parseCalled)
{
throw new IOException(
@@
-192,7
+205,11
@@
public abstract class AlignFile extends FileParse
}
parseCalled = true;
parse();
}
parseCalled = true;
parse();
- dataIn.close();
+ if (closeData && !dataClosed)
+ {
+ dataIn.close();
+ dataClosed = true;
+ }
}
/**
}
/**