FileOutputStream

public protocol FileOutputStream : LuaWrapper, Closeable

File output stream.

  • write(_:length:) Default implementation

    Writes the given amount of bytes from the buffer to the stream. Returns the written amount of bytes.

    Default Implementation

    Writes the given amount of bytes from the buffer to the stream. Returns the written amount of bytes.

    Declaration

    Swift

    func write(_ buffer: UnsafePointer<UInt8>, length: Int) throws -> Int
  • Changes the mode of the underlying file.

    Declaration

    Swift

    func chmod(mode: mode_t) throws
  • Flushes the file contents to the file system. This is typically invoked once, just before closing the stream.

    The difference with close() is that flush() may throw an error.

    Declaration

    Swift

    func flush() throws
  • write(data:) Extension method

    Writes the received Data contents fo the stream. Returns the written amount of bytes.

    Declaration

    Swift

    public func write(data: Data) throws -> Int