Hi Yusuf. Thanks for the answer.

and don't worry, I did read the guide. my concern was more what
required fewest cpu-cycles :)

I have done the following:

public void saveSampleSequense(FileOutputStream out) throws
IOException
{
  DataOutputStream p = new DataOutputStream(out);
  p.writeInt(mMaxAge);
  int nSamples = getNumSamples();
  for (int i=0;i<nSamples;++i)
  {
    p.writeFloat(mSamples[ (i+mSampleIndex) % mMaxAge ]);
  }
}
public void loadSampleSequense(FileInputStream in) throws IOException
{
  DataInputStream p = new DataInputStream(in);
  int readMaxAge = p.readInt();
  if (readMaxAge != mMaxAge)
  {
    mMaxAge = readMaxAge;
    mSamples = new float[mMaxAge];
  }
  for (int i = 0; i < readMaxAge; ++i)
  {
    addSample( p.readFloat() );
  }
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to