InputStreams opened from distinct files. Only a single
instance is ever opened from the same file. This is used to read special
infinite files like /dev/random where the current file pointer is not
relevant, so multiple readers can share the same file descriptor and
consequently the same InputStream.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final ConcurrentMap | pool
a pool of: StreamRef -> UnclosableInputStream -> FileInputStream(s) |
| private static final ReferenceQueue | refQueue
a reference queue of cleared StreamRef(s) |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static InputStream | Returns: a sharedjava. instance opened from given
file.the file to be opened for reading. file)This method opens an underlying |
| pool | back to summary |
|---|---|
| private static final ConcurrentMap<File, FileInputStreamPool. a pool of: StreamRef -> UnclosableInputStream -> FileInputStream(s) | |
| refQueue | back to summary |
|---|---|
| private static final ReferenceQueue<FileInputStreamPool. a reference queue of cleared StreamRef(s) | |
| FileInputStreamPool | back to summary |
|---|---|
| pack-priv FileInputStreamPool() | |
| getInputStream | back to summary |
|---|---|
| pack-priv static InputStream getInputStream(File file) throws IOException This method opens an underlying
| |
| Access | Constructor and Description |
|---|---|
| pack-priv | StreamRef(File file, FileInputStreamPool.
|
| file | back to summary |
|---|---|
| pack-priv final File file | |
| StreamRef | back to summary |
|---|---|
| pack-priv StreamRef(File file, FileInputStreamPool. | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this input stream and releases any system resources associated with the stream. |
| pack-priv InputStream |
| UnclosableInputStream | back to summary |
|---|---|
| pack-priv UnclosableInputStream(InputStream in) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream.
| |
| getWrappedStream | back to summary |
|---|---|
| pack-priv InputStream getWrappedStream() | |