Package org.cryptacular.io
Interface Resource
- All Known Implementing Classes:
ClassPathResource
,FileResource
,URLResource
public interface Resource
Resource descriptor that provides a strategy to get an
InputStream
to read bytes.- Author:
- Middleware Services
-
Method Summary
Modifier and TypeMethodDescriptionGets an input stream around the resource.
-
Method Details
-
getInputStream
Gets an input stream around the resource. Callers of this method are responsible for resource cleanup; it should be sufficient to simply callInputStream.close()
unless otherwise noted.Implementers should produce a new instance on every call to this method to provide for thread-safe usage patterns on a shared resource.
- Returns:
- Input stream around underlying resource, e.g. file, remote resource (URI), etc.
- Throws:
IOException
- On IO errors.
-