map

inline fun <T : Any, R : Any> Buffer<T>.map(bufferFactory: BufferFactory<R> = Buffer.Companion::auto, 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.