Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
1e405316
Commit
1e405316
authored
13 years ago
by
brinn
Browse files
Options
Downloads
Patches
Plain Diff
fix: revert last change, Closeable _is_ needed
SVN: 20887
parent
0280f79e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/source/java/ch/systemsx/cisd/common/io/HDF5DataSetBasedContent.java
+16
-1
16 additions, 1 deletion
...a/ch/systemsx/cisd/common/io/HDF5DataSetBasedContent.java
with
16 additions
and
1 deletion
common/source/java/ch/systemsx/cisd/common/io/HDF5DataSetBasedContent.java
+
16
−
1
View file @
1e405316
...
...
@@ -16,8 +16,11 @@
package
ch.systemsx.cisd.common.io
;
import
java.io.Closeable
;
import
java.io.File
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
import
ch.systemsx.cisd.base.io.AdapterIInputStreamToInputStream
;
import
ch.systemsx.cisd.base.io.IRandomAccessFile
;
...
...
@@ -31,7 +34,7 @@ import ch.systemsx.cisd.hdf5.io.HDF5DataSetRandomAccessFile;
*
* @author Bernd Rinn
*/
public
class
HDF5DataSetBasedContent
implements
IContent
public
class
HDF5DataSetBasedContent
implements
IContent
,
Closeable
{
private
final
File
hdf5File
;
...
...
@@ -43,6 +46,8 @@ public class HDF5DataSetBasedContent implements IContent
private
final
long
size
;
private
final
List
<
HDF5DataSetRandomAccessFile
>
randomAccessFiles
;
public
HDF5DataSetBasedContent
(
File
hdf5File
,
String
dataSetPath
)
{
this
.
hdf5File
=
hdf5File
;
...
...
@@ -59,6 +64,7 @@ public class HDF5DataSetBasedContent implements IContent
this
.
size
=
0L
;
}
reader
.
close
();
this
.
randomAccessFiles
=
new
ArrayList
<
HDF5DataSetRandomAccessFile
>();
}
public
String
tryGetName
()
...
...
@@ -80,6 +86,7 @@ public class HDF5DataSetBasedContent implements IContent
{
final
HDF5DataSetRandomAccessFile
randomAccessFile
=
HDF5DataSetRandomAccessFile
.
createForReading
(
hdf5File
,
dataSetPath
);
randomAccessFiles
.
add
(
randomAccessFile
);
return
randomAccessFile
;
}
...
...
@@ -88,4 +95,12 @@ public class HDF5DataSetBasedContent implements IContent
return
new
AdapterIInputStreamToInputStream
(
getReadOnlyRandomAccessFile
());
}
public
void
close
()
{
for
(
HDF5DataSetRandomAccessFile
raFile
:
randomAccessFiles
)
{
raFile
.
close
();
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment