which relies on the same stream implementation to be able to generate the stream, however most of the stream are just reading up to the point and skipping unneeded.
The idea is to make it as a separate stream. It'll remove a lot of ugliness in the code where BeanStream<T,S> must have second generic type only to return back the proper type of the stream.
So, it should simplify the BeanStream<T,S> to BeanStream<T> and rangeProjection will become an extension function, and might be event renamed.
fun BeanStream<T>.range(from: Int, to: Int?, timeUnit: TimeUnit): BeanStream<T> { /* ... */ }
BeanStream<T> should be extended with the function that converts time to sample index within certain sample rate.
Currently the API looks like this:
which relies on the same stream implementation to be able to generate the stream, however most of the stream are just reading up to the point and skipping unneeded.
The idea is to make it as a separate stream. It'll remove a lot of ugliness in the code where
BeanStream<T,S>
must have second generic type only to return back the proper type of the stream.So, it should simplify the
BeanStream<T,S>
toBeanStream<T>
and rangeProjection will become an extension function, and might be event renamed.BeanStream<T>
should be extended with the function that converts time to sample index within certain sample rate.