基于流(Stream)的解决 流是单向的有方向性的描述信息流的对象,InputStream是输入流的接口,对程序来说是入,是读,可以从文件读,缓存区读,网络节点读等等. 写入文件,对程序来说是出,是写,就是FileOutputStream,可以写入int也可以byte[] 所以解决方案就是从InputStream中读出内存到byte[]中然后,使用FileOutputStream写入文件中.比如:其中一种写法 InputStream is = new FileInputStream("a.txt
把QString写到文件中可以用toutf8()函数 QByteArray QString::toUtf8() const Returns a UTF-8 representation of the string as a QByteArray. UTF-8 is a Unicode codec and can represent all characters in a Unicode string like QString.
using System; using System.Collections.Generic; using System.Web; using System.IO; using System.Text; /// <summary> /// Summary description for NetLog /// </summary> public class NetLog { /// <summary> /// 写入日志到文本文件 /// </summary>
转:http://stackoverflow.com/questions/11382057/declaring-a-delegate-protocol There definitely are subtle differences. If the protocol you are talking about is a delegate that is used by one particular class, for example, MySpecialViewController, and M