import java.io.FileReader; ・・・ String filename = "c:\\hoge.txt" FileReader reader = new FileReader(filename); char c = (char)reader.read(); // 1文字読み込み reader.close();
import java.io.FileWriter; ・・・ String filename="c:\\hoge.txt" FileWriter writer = new FileWriter(filename); writer.write('あ'); writer.close();
import java.io.InputStream; import java.net.URL; ・・・ URL url = new URL("https://s-soto.mydns.jp/wiki"); InputStream in = url.openStream(); int i = in.read(); while (i != -1) { System.out.print((char)i); i = in.read(); } in.close();