public class WrappedFileInputStream extends FileInputStream implements DuplicatableInputStream
Simple wrapper over FileInputStream that also exposes the File used to create the stream.
This version also support mark/reset.
| Constructor and Description |
|---|
WrappedFileInputStream(File file) |
| Modifier and Type | Method and 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() |
available, close, finalize, getChannel, getFD, read, read, read, skippublic WrappedFileInputStream(File file) throws FileNotFoundException
FileNotFoundExceptionpublic boolean markSupported()
markSupported in class InputStreampublic void mark(int readlimit)
mark in class InputStreampublic void reset()
throws IOException
reset in class InputStreamIOExceptionpublic InputStream duplicate()
duplicate in interface DuplicatableInputStreampublic static WrappedFileInputStream create(File file)
Same as calling the ctor, except will throw an unchecked IllegalArgumentException if the file isn’t found.
file - the file to read from.public File getSourceFile()
Copyright © 2016–2024. All rights reserved.