Android examples for java.lang:array
count Zeros in short array
public class Main{ public static int countZeros(short[] audioData) { int numZeros = 0; for (int i = 0; i < audioData.length; i++) { if (audioData[i] == 0) { numZeros++;// w w w. j av a 2s .co m } } return numZeros; } }