Class NfsFileOutputStream

java.lang.Object
java.io.OutputStream
com.emc.ecs.nfsclient.nfs.io.NfsFileOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class NfsFileOutputStream extends OutputStream
The NFS equivalent of java.io.FileOutputStream.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a file output stream to write to the file represented by the specified NfsFile object, starting at offset = 0 and using syncType = 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 specified NfsFile object, starting at offset = 0 and using syncType behavior.
    NfsFileOutputStream(NfsFile<?,?> nfsFile, long offset, int syncType)
    Creates a file output stream to write to the file represented by the specified NfsFile object, starting at offset and using syncType behavior.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    void
    void
    write(byte[] b)
    void
    write(byte[] b, int off, int len)
    void
    write(int b)

    Methods inherited from class OutputStream

    nullOutputStream

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NfsFileOutputStream

      public NfsFileOutputStream(NfsFile<?,?> nfsFile) throws IOException
      Creates a file output stream to write to the file represented by the specified NfsFile object, starting at offset = 0 and using syncType = 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

      public NfsFileOutputStream(NfsFile<?,?> nfsFile, int syncType) throws IOException
      Creates a file output stream to write to the file represented by the specified NfsFile object, starting at offset = 0 and using syncType behavior.

      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

      public NfsFileOutputStream(NfsFile<?,?> nfsFile, long offset, int syncType) throws IOException
      Creates a file output stream to write to the file represented by the specified NfsFile object, starting at offset and using syncType behavior.

      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