diff options
Diffstat (limited to 'tools/wixl/util.vala')
-rw-r--r-- | tools/wixl/util.vala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/wixl/util.vala b/tools/wixl/util.vala index e7fadcc..13269c7 100644 --- a/tools/wixl/util.vala +++ b/tools/wixl/util.vala @@ -143,4 +143,20 @@ namespace Wixl { return -1; } + + public class UnixInputStream : GLib.InputStream { + public int fd { get; set construct; } + + public UnixInputStream(int fd_) { + fd = fd_; + } + + public override ssize_t read ([CCode (array_length_type = "gsize")] uint8[] buffer, GLib.Cancellable? cancellable = null) throws GLib.IOError { + return Posix.read(fd, buffer, buffer.length); + } + + public override bool close(GLib.Cancellable? cancellable = null) throws GLib.IOError { + return true; + } + } } // Wixl |