for(int i=0;i<returned;i++){
// keep the current sample from the chain
storedSamples.addElement(new Float(buffer[i]));
// replace it with a stored sample
Float tempFloat = (Float)storedSamples.elementAt(storedSamples.size()-1);
buffer[i] = tempFloat.floatValue();
// remove the used stored sample
storedSamples.removeElementAt(storedSamples.size()-1);
}
} else { // early on pad with silence