code: public long resample(final long samples, final Timebase oldRate, boolean failOnPrecisionLoss) throws ResamplingException
  	{
  		final double resampled = resample((double) samples, oldRate);
  		final double rounded = Math.round(resampled);
  
  		// Warn about significant loss of precision
  		if (resampled != rounded && Math.abs(rounded - resampled) > 0.000001)
  		{
  			if (failOnPrecisionLoss)
  			{
  				throw new ResamplingException("Resample " +
  				                              samples +
  				                              " from " +
  				                              oldRate +
  				                              " to " +
  				                              this +
  				                              " would lose precision by rounding " +
  				                              resampled);
  			}
  			else
  			{
  				if (WARN_ON_PRECISION_LOSS)
  					log.warn("Resample operation lost precision: " +
  					         samples +
  					         " from " +
  					         oldRate +
  					         " to " +
  					         this +
  					         " produced " +
  					         resampled +
  					         " which will be rounded to " +
  					         rounded);
  			}
  		}
  
  		return (long) rounded;
  	}
docs: Convert a sample count from one timebase to another<br />
  Note that this may result in data loss due to rounding.
  
  @param samples
  @param oldRate
  @param failOnPrecisionLoss
  if true, precision losing operations will fail by throwing a PrecisionLostException
  
  @return