public class Test {
public static void main(String[] args) throws IOException {
FileOutputStream fos = new FileOutputStream("h.txt");
fos.write(256);
FileInputStream fis = new FileInputStream("h.txt");
int x = fis.read();
System.out.println(x);
fis.close();
fos.close();
}
}
为什么运行结果会是0呢?看了下API关于write(int)方法没理解,求大神解释 |
|