use of org.apache.commons.io.input.AutoCloseInputStream in project jackrabbit by apache.
the class PropertyImpl method getStream.
/** Wrapper around {@link #getValue()} */
public InputStream getStream() throws RepositoryException {
final Binary binary = getValue().getBinary();
// make sure binary is disposed after stream had been consumed
return new AutoCloseInputStream(binary.getStream()) {
@Override
public void close() throws IOException {
super.close();
binary.dispose();
}
};
}
Aggregations