Class NfsFileOutputStream
java.lang.Object
java.io.OutputStream
com.emc.ecs.nfsclient.nfs.io.NfsFileOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
The NFS equivalent of
java.io.FileOutputStream.-
Constructor Summary
ConstructorsConstructorDescriptionNfsFileOutputStream(NfsFile<?, ?> nfsFile) Creates a file output stream to write to the file represented by the specifiedNfsFileobject, starting atoffset = 0and usingsyncType = FILE_SYNC(commit all data and metadata to stable storage before returning).NfsFileOutputStream(NfsFile<?, ?> nfsFile, int syncType) Creates a file output stream to write to the file represented by the specifiedNfsFileobject, starting atoffset = 0and usingsyncTypebehavior.NfsFileOutputStream(NfsFile<?, ?> nfsFile, long offset, int syncType) Creates a file output stream to write to the file represented by the specifiedNfsFileobject, starting atoffsetand usingsyncTypebehavior. -
Method Summary
Methods inherited from class OutputStream
nullOutputStream
-
Constructor Details
-
NfsFileOutputStream
Creates a file output stream to write to the file represented by the specifiedNfsFileobject, starting atoffset = 0and usingsyncType = FILE_SYNC(commit all data and metadata to stable storage before returning).If the file does not exist, it will first be created.
- Parameters:
nfsFile- The file to be opened for writing.- Throws:
IOException- If the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
-
NfsFileOutputStream
Creates a file output stream to write to the file represented by the specifiedNfsFileobject, starting atoffset = 0and usingsyncTypebehavior.If the file does not exist, it will first be created.
- Parameters:
nfsFile- The file to be opened for writing.syncType- One of the values below.- UNSTABLE = 0 - Best effort, no promises.
- DATA_SYNC = 1 - Commit all data to stable storage, plus enough metadata for retrieval, before returning.
- FILE_SYNC = 2 - Commit all data and metadata to stable storage before returning.
- Throws:
IOException- If the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
-
NfsFileOutputStream
Creates a file output stream to write to the file represented by the specifiedNfsFileobject, starting atoffsetand usingsyncTypebehavior.If the file does not exist, it will first be created.
- Parameters:
nfsFile- The file to be opened for writing.offset- Where to start writing to the file.syncType- One of the values below.- UNSTABLE = 0 - Best effort, no promises.
- DATA_SYNC = 1 - Commit all data to stable storage, plus enough metadata for retrieval, before returning.
- FILE_SYNC = 2 - Commit all data and metadata to stable storage before returning.
- Throws:
IOException- If the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-