文件流
Posted lbx6935
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了文件流相关的知识,希望对你有一定的参考价值。
var fs = require("fs");
var readstream = fs.createReadStream(__dirname + "\\stuff\\readMe.txt");
var writestream = fs.createWriteStream(__dirname + "\\stuff\\writeMe.txt")
readstream.setEncoding("utf-8");
var str = "";
readstream.on("data", function (data) {
str += data;
writestream.write(data); //写入
});
readstream.on("end", function () {
console.log(str);
});
/*
var readstream = fs.createReadStream(__dirname + "\\stuff\\readMe.txt");
var writestream = fs.createWriteStream(__dirname + "\\stuff\\writeMe.txt")
readstream.pipe(writestream);
*/
以上是关于文件流的主要内容,如果未能解决你的问题,请参考以下文章
java缓冲字符字节输入输出流:java.io.BufferedReaderjava.io.BufferedWriterjava.io.BufferedInputStreamjava.io.(代码片段
此应用小部件片段中所有意图 (PendingIntents) 的逻辑流