How to paginate a array

Hi all,

I have written a searching method and the results does not belong to a
particular table. The results are in a array: @products << lineitem. Now
i want to paginate the @products array.
Please give me some solution to paginate an array.

Thanks and Regards,
Rohit.