Package jcifs.smb

Class SmbFileOutputStream

    • Constructor Detail

      • SmbFileOutputStream

        public SmbFileOutputStream​(SmbFile file)
                            throws SmbException
        Creates an OutputStream for writing bytes to a file on an SMB server represented by the SmbFile parameter. See SmbFile for a detailed description and examples of the smb URL syntax.
        Parameters:
        file - An SmbFile specifying the file to write to
        Throws:
        SmbException
      • SmbFileOutputStream

        public SmbFileOutputStream​(SmbFile file,
                                   boolean append)
                            throws SmbException
        Creates an OutputStream for writing bytes to a file on an SMB server addressed by the SmbFile parameter. See SmbFile for a detailed description and examples of the smb URL syntax. If the second argument is true, then bytes will be written to the end of the file rather than the beginning.
        Parameters:
        file - An SmbFile representing the file to write to
        append - Append to the end of file
        Throws:
        SmbException
    • Method Detail

      • write

        public void write​(int b)
                   throws IOException
        Writes the specified byte to this file output stream.
        Specified by:
        write in class OutputStream
        Throws:
        IOException - if a network error occurs
      • write

        public void write​(byte[] b)
                   throws IOException
        Writes b.length bytes from the specified byte array to this file output stream.
        Overrides:
        write in class OutputStream
        Throws:
        IOException - if a network error occurs
      • isOpen

        public boolean isOpen()
        Returns:
        whether the stream is open
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
                   throws IOException
        Writes len bytes from the specified byte array starting at offset off to this file output stream.
        Overrides:
        write in class OutputStream
        Parameters:
        b - The array
        Throws:
        IOException - if a network error occurs
      • writeDirect

        public void writeDirect​(byte[] b,
                                int off,
                                int len,
                                int flags)
                         throws IOException
        Just bypasses TransWaitNamedPipe - used by DCERPC bind.
        Parameters:
        b -
        off -
        len -
        flags -
        Throws:
        IOException