             stream.writeJSONEscaped(string)
         }
     }
+
+    public func close() throws {
+        try queue.sync {
+            try stream.close()
+        }
+    }
 }
 
 /// Define an output stream operator. We need it to be left associative, so we


    /// Flush the stream's buffer.
    func flush()
}

// Public alias to the old name to not introduce API compatibility.

        fflush(filePointer)
    }

    override final func fileCloseImpl() throws {
        defer {
            fclose(filePointer)
            // If clients called close we shouldn't call fclose again in deinit.
