I write to the framebuffer located at / dev / fb 0. Everything works fine until I try again to write the handset using an OutputStream, which is program dependent. I solved this by closing the output stream and then recreating it, but it seems terribly slow and dumb.
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);
}
}
code>
Any ideas?
Thank.
source
share