public long [ ] getSamples ( ) { if ( itemsSeen_ == 0 ) { return null ; } final int numSamples = ( int ) Math . min ( reservoirSize_ , itemsSeen_ ) ; return java . util . Arrays . copyOf ( data_ , numSamples ) ; }
Returns a copy of the items in the reservoir . The returned array length may be smaller than the reservoir capacity .