Package org.apache.jackrabbit.util
Class LazyFileInputStream
java.lang.Object
java.io.InputStream
org.apache.jackrabbit.util.LazyFileInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
This Class implements an InputStream that provides the same functionality
as a
FileInputStream but opens the file by the first file access.-
Constructor Summary
ConstructorsConstructorDescriptionLazyFileInputStream(File file) Creates a newLazyFileInputStreamfor the given file.Creates a newLazyFileInputStreamfor the given file desciptor.LazyFileInputStream(String name) Creates a newLazyFileInputStreamfor the given file. -
Method Summary
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
LazyFileInputStream
Creates a newLazyFileInputStreamfor the given file. If the file is unreadably, a FileNotFoundException is thrown.- Parameters:
file-- Throws:
FileNotFoundException
-
LazyFileInputStream
Creates a newLazyFileInputStreamfor the given file desciptor.- Parameters:
fdObj-
-
LazyFileInputStream
Creates a newLazyFileInputStreamfor the given file. If the file is unreadably, a FileNotFoundException is thrown.- Parameters:
name-- Throws:
FileNotFoundException
-
-
Method Details
-
open
Opens the underlying file input stream in neccessairy.- Throws:
IOException
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-