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 WrappedFileInputStream
create(File file)
Same as calling the ctor, except will throw an unchecked IllegalArgumentException if the file isn’t found.InputStream
duplicate()
File
getSourceFile()
void
mark(int readlimit)
boolean
markSupported()
void
reset()
-
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:
markSupported
in classInputStream
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classInputStream
-
reset
public void reset() throws IOException
- Overrides:
reset
in classInputStream
- Throws:
IOException
-
duplicate
public InputStream duplicate()
- Specified by:
duplicate
in 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()
-
-