Class WritableSharedFile

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, SharedInputStream

    class WritableSharedFile
    extends SharedFileInputStream
    A subclass of SharedFileInputStream that also allows writing.
    • Field Detail

      • raf

        private java.io.RandomAccessFile raf
    • Constructor Detail

      • WritableSharedFile

        public WritableSharedFile​(java.io.File file)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getWritableFile

        public java.io.RandomAccessFile getWritableFile()
        Return the writable version of this file.
      • close

        public void close()
                   throws java.io.IOException
        Close the readable and writable files.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class SharedFileInputStream
        Throws:
        java.io.IOException - if an I/O error occurs.
      • updateLength

        long updateLength()
                   throws java.io.IOException
        Update the size of the readable file after writing to the file. Updates the length to be the current size of the file.
        Throws:
        java.io.IOException
      • getAppendStream

        public AppendStream getAppendStream()
                                     throws java.io.IOException
        Return a new AppendStream, but only if one isn't in active use.
        Throws:
        java.io.IOException