import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class Main {
public void readOneByte() throws FileNotFoundException {
FileInputStream file = null;
byte x = -1;
try {
file = new FileInputStream("fileName");
x = (byte) file.read();
} catch (FileNotFoundException f) {
throw f;
} catch (IOException i) {
i.printStackTrace();
} finally {
try {
if (file != null) {
file.close();
}
} catch (IOException e) {
}
}
}
}
文件读字节
最新推荐文章于 2021-05-24 17:51:06 发布