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