Class NfsFileInputStream
java.lang.Object
java.io.InputStream
com.emc.ecs.nfsclient.nfs.io.NfsFileInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
The NFS equivalent of
java.io.FileInputStream.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNfsFileInputStream(NfsFile<?, ?> nfsFile) Creates aNfsFileInputStreamby opening a connection to an actual NFS file, starting to read at offset 0 and using the preferred buffer size as the maximums.NfsFileInputStream(NfsFile<?, ?> nfsFile, int maximumBufferSize) Creates aNfsFileInputStreamby opening a connection to an actual NFS file, starting to read at offset 0 and using the specified maximum buffer size.NfsFileInputStream(NfsFile<?, ?> nfsFile, long offset, int maximumBufferSize) Creates aNfsFileInputStreamby opening a connection to an actual NFS file, using the specifiedoffsetandmaximumBufferSize. -
Method Summary
Methods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
EOF
public static final int EOFConstant for output.- See Also:
-
-
Constructor Details
-
NfsFileInputStream
public NfsFileInputStream(NfsFile<?, ?> nfsFile, long offset, int maximumBufferSize) throws IOExceptionCreates aNfsFileInputStreamby opening a connection to an actual NFS file, using the specifiedoffsetandmaximumBufferSize.If the named file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading then a
FileNotFoundExceptionis thrown.- Parameters:
nfsFile- The NFS file instance to be read.offset- The offset at which reading should start, in bytes.maximumBufferSize- The maximum buffer size to use in bytes.- Throws:
IOException- If the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
-
NfsFileInputStream
Creates aNfsFileInputStreamby opening a connection to an actual NFS file, starting to read at offset 0 and using the specified maximum buffer size.If the named file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading then a
FileNotFoundExceptionis thrown.- Parameters:
nfsFile- The NFS file instance to be read.maximumBufferSize- The maximum buffer size to use in bytes.- Throws:
IOException- If the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
-
NfsFileInputStream
Creates aNfsFileInputStreamby opening a connection to an actual NFS file, starting to read at offset 0 and using the preferred buffer size as the maximums. This constructor will generally give you the best performance.If the named file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading then a
FileNotFoundExceptionis thrown.- Parameters:
nfsFile- The NFS file instance to be read.- Throws:
IOException- If the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
-
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-