Back to project page bard-droid.
The source code is released under:
GNU General Public License
If you think the Android project bard-droid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package in.co.praveenkumar.bard.graphics; /*from w ww . ja va 2 s . c o m*/ import java.nio.ByteBuffer; public class Frame { public static final int FRAME_LENGTH = FrameSettings.WIDTH * FrameSettings.HEIGHT * FrameSettings.BPP; // Temp variables public static int bytesReceived = 0; public static int frameCount = 0; // Frame data will be hold in this public static ByteBuffer frameBuffer = ByteBuffer.allocate(FRAME_LENGTH); public static int add(byte[] page) { frameBuffer.put(page); // Reset position if end is reached if (frameBuffer.position() >= FRAME_LENGTH) frameBuffer.position(0); return frameBuffer.position(); } public static ByteBuffer current() { return frameBuffer; } }