Class TFileOutputStream

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

    public class TFileOutputStream
    extends java.io.OutputStream
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean closed  
      private java.io.FileDescriptor fd  
      private java.lang.String path  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      private void close0​(java.io.FileDescriptor fd)  
      java.io.FileDescriptor getFD()  
      private void open​(java.io.FileDescriptor fd, java.lang.String name, boolean append)  
      private int open0​(java.io.FileDescriptor fd, java.lang.String name, boolean append)  
      void write​(byte[] b)  
      void write​(byte[] b, int off, int len)  
      void write​(int b)  
      private void writeBytes​(java.io.FileDescriptor fd, byte[] b, int off, int len)  
      void writeInt​(java.io.FileDescriptor fd, int b)  
      • Methods inherited from class java.io.OutputStream

        flush, nullOutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • fd

        private final java.io.FileDescriptor fd
      • path

        private final java.lang.String path
      • closed

        private volatile boolean closed
    • Constructor Detail

      • TFileOutputStream

        public TFileOutputStream​(java.lang.String name)
                          throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • TFileOutputStream

        public TFileOutputStream​(java.lang.String name,
                                 boolean append)
                          throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • TFileOutputStream

        public TFileOutputStream​(java.io.File file)
                          throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • TFileOutputStream

        public TFileOutputStream​(java.io.File file,
                                 boolean append)
                          throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • TFileOutputStream

        public TFileOutputStream​(java.io.FileDescriptor fdObj)
    • Method Detail

      • open0

        private int open0​(java.io.FileDescriptor fd,
                          java.lang.String name,
                          boolean append)
                   throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • close0

        private void close0​(java.io.FileDescriptor fd)
      • open

        private void open​(java.io.FileDescriptor fd,
                          java.lang.String name,
                          boolean append)
                   throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • write

        public void write​(int b)
                   throws java.io.IOException
        Specified by:
        write in class java.io.OutputStream
        Throws:
        java.io.IOException
      • writeInt

        public void writeInt​(java.io.FileDescriptor fd,
                             int b)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • writeBytes

        private void writeBytes​(java.io.FileDescriptor fd,
                                byte[] b,
                                int off,
                                int len)
      • write

        public void write​(byte[] b)
        Overrides:
        write in class java.io.OutputStream
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
        Overrides:
        write in class java.io.OutputStream
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.io.OutputStream
      • getFD

        public final java.io.FileDescriptor getFD()
                                           throws java.io.IOException
        Throws:
        java.io.IOException