Package com.google.common.jimfs
Class JimfsInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.google.common.jimfs.JimfsInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
final class JimfsInputStream extends java.io.InputStream
InputStream
for reading from a file'sRegularFile
.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) RegularFile
file
private FileSystemState
fileSystemState
private boolean
finished
private long
pos
-
Constructor Summary
Constructors Constructor Description JimfsInputStream(RegularFile file, FileSystemState fileSystemState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
private void
checkNotClosed()
void
close()
private boolean
isOpen()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
private int
readInternal(byte[] b, int off, int len)
long
skip(long n)
-
-
-
Field Detail
-
file
RegularFile file
-
pos
private long pos
-
finished
private boolean finished
-
fileSystemState
private final FileSystemState fileSystemState
-
-
Constructor Detail
-
JimfsInputStream
public JimfsInputStream(RegularFile file, FileSystemState fileSystemState)
-
-
Method Detail
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
readInternal
private int readInternal(byte[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.InputStream
- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException
- Overrides:
available
in classjava.io.InputStream
- Throws:
java.io.IOException
-
checkNotClosed
private void checkNotClosed() throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
isOpen
private boolean isOpen()
-
-