public int skip(int len) throws IllegalArgumentException, IOException
  {
    int bytesRead = 0;
    int bytesToRead = 0;
    int total = 0;

    //check len
    if(len < 0)
      throw new IllegalArgumentException("len must be a positve value");

    //skip by reading blocks of the size of the buffer
    int blockSize = inputBuffer.length;

    //compute byte to read
    bytesToRead = len * frameSize;

    //read new data from inputstream
    while(total < bytesToRead)
    {
      //adjust blockSize for the last block to skip
      if(blockSize > bytesToRead - total)
        blockSize = bytesToRead - total;

      //read one block of data
      bytesRead = read(blockSize);

      //compute total bytes read
      total += bytesRead;

      //check if we read the correct number of bytes
      if(blockSize != bytesRead)
        return total/frameSize;
    }

    //return number of samples read
    return total/frameSize;
  }