【发布时间】:2010-01-31 00:58:55
【问题描述】:
我正在写入位于“/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);
}
}
有什么想法吗?
谢谢。
【问题讨论】:
标签: java pipe outputstream