Back to project page bike-friend.
The source code is released under:
GNU General Public License
If you think the Android project bike-friend 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 com.lemoulinstudio.bikefriend.webapp.io; // w ww .j a va 2 s. c om import java.io.IOException; import java.io.InputStream; /** * * @author Vincent Cantin */ public class IntArrayInputStream extends InputStream { private final int[] data; private int index; // Index in the stream, it counts the bytes. public IntArrayInputStream(int[] data) { this.data = data; this.index = 0; } @Override public int read() throws IOException { int val = data[index / 4] >> ((index % 4) * 8) & 0xff; index++; return val; } @Override public int available() throws IOException { return data.length * 4 - index; } @Override public boolean markSupported() { return false; } }