Package com.oracle.bmc.io.internal
Class WrappedFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FileInputStream
-
- com.oracle.bmc.io.internal.WrappedFileInputStream
-
- All Implemented Interfaces:
com.oracle.bmc.http.client.io.DuplicatableInputStream,Closeable,AutoCloseable
public class WrappedFileInputStream extends FileInputStream implements com.oracle.bmc.http.client.io.DuplicatableInputStream
Simple wrapper over FileInputStream that also exposes the File used to create the stream.This version also support mark/reset.
-
-
Constructor Summary
Constructors Constructor Description WrappedFileInputStream(File file)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WrappedFileInputStreamcreate(File file)Same as calling the ctor, except will throw an unchecked IllegalArgumentException if the file isn’t found.InputStreamduplicate()FilegetSourceFile()voidmark(int readlimit)booleanmarkSupported()voidreset()-
Methods inherited from class java.io.FileInputStream
available, close, finalize, getChannel, getFD, read, read, read, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
WrappedFileInputStream
public WrappedFileInputStream(File file) throws FileNotFoundException
- Throws:
FileNotFoundException
-
-
Method Detail
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
mark
public void mark(int readlimit)
- Overrides:
markin classInputStream
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
duplicate
public InputStream duplicate()
- Specified by:
duplicatein interfacecom.oracle.bmc.http.client.io.DuplicatableInputStream
-
create
public static WrappedFileInputStream create(File file)
Same as calling the ctor, except will throw an unchecked IllegalArgumentException if the file isn’t found.- Parameters:
file- the file to read from.- Returns:
- a new stream.
-
getSourceFile
public File getSourceFile()
-
-