private <A> void copyTo(final A[] array) {
		assert array.length >= _size;

		if (_size < _buffer.length || _index == 0) {
			arraycopy(_buffer, 0, array, 0, _size);
		} else {
			arraycopy(_buffer, _index, array, 0, _buffer.length - _index);
			arraycopy(_buffer, 0, array, _buffer.length - _index, _index);
		}
	}
Return a snapshot of the current buffer content.

@param generator a function which produces a new array of the desired
       type and the provided length
@param <A> the element type of the resulting array
@return the buffer snapshot
@throws ArrayStoreException if an element in the {@code value} array
        could not be stored into the dest array because of a type mismatch
@throws NullPointerException if the given {@code generator} is {@code null}
jenetics/src/main/java/io/jenetics/util/Buffer.java