map

inline fun <T : Any, R : Any> Buffer<T>.map(block: (T) -> R): Buffer<R>

Create a new buffer from this one with the given mapping function and using Buffer.Companion.auto buffer factory.


inline fun <T : Any, R : Any> Buffer<T>.map(bufferFactory: BufferFactory<R>, crossinline block: (T) -> R): Buffer<R>

Create a new buffer from this one with the given mapping function. Provided bufferFactory is used to construct the new buffer.