我正在写入位于“/dev/fb0”的帧缓冲区。一切正常,直到我尝试使用挂起程序的 OutputStream 再次写入管道。我已经通过关闭输出流然后重新创建它来解决这个问题,但这似乎非常缓慢和生硬。
Framebuffer.java
public class Framebuffer extends Autobuffer {
private FileOutputStream out = null;
private File pipe = null;
public Framebuffer() {
super(320, 240);
}
public Framebuffer(File pipe) {
super(320, 240);
try {
out = new FileOutputStream(pipe);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
this.pipe = pipe;
}
public void sync() throws IOException {
out.write(getBytes());
out.close();
out = new FileOutputStream(pipe);
}
}
有任何想法吗?
谢谢。