【问题标题】:How to create InputStream from string in Vala如何从 Vala 中的字符串创建 InputStream
【发布时间】:2011-10-12 04:22:43
【问题描述】:

给定一个名为command的字符串,我需要创建GLib InputStream对象如何?谢谢

【问题讨论】:

    标签: vala gio


    【解决方案1】:
    string command = "foobar";
    GLib.InputStream input_stream = new GLib.MemoryInputStream.from_data (command.data, GLib.g_free);
    

    【讨论】:

    • GLib.g_free 调用甚至不是我想要的,但更好的发现
    猜你喜欢
    • 2020-06-27
    • 2011-08-08
    • 2012-02-18
    • 1970-01-01
    • 2014-03-21
    • 2022-07-01
    • 2022-12-04
    • 1970-01-01
    • 2011-04-12
    相关资源
    最近更新 更多