public static interface ThrottledByteSource.Curve
The throttling is based on a curve b(t). At time t, the total number of bytes served should not exceed b(t).
The unit of t is milli-second. t is relative to the 1st read, i.e. t=0 on the first read() call.
This interface uses
long type for b and t.
Both the caller and the implementer should be careful with arithmetic precisions.
long b(long t)
Required: if t1<=t2, then b(t1)<=b(t2)
long t(long b)
Required: t(b(x)) = x (approximately)
static ThrottledByteSource.Curve linear(long b0, long bytesPerSecond)
The curve will be b(t) = b0 + t * bytesPerSecond / 1000
CAUTION: the unit of `bytesPerSecond` is byte/second, not milli-second.