Package: java.util.stream

## Interface LongStream

- - ### Methods Summary

    Methods
    Return type | Name and parameters
    --- | ---
    `long` | `size()` An alias for `count`.

  - #### Methods inherited from interface java.util.stream.BaseStream

    `toList`, `toSet`

- - ### Methods Detail

    - #### public long size()

      An alias for `count`. Returns the count of elements for this stream. This is a terminal operator and, depending on the underlying stream, may invoke the stream pipeline, leaving it empty after this call. Care should be taken with stream pipelines that have side effects. This method should not be called on an infinite stream.

          long[] nums = [1, 2, 3]
          assert nums.longStream().size() == 3

      Returns:
        the count of elements in this stream
      Since:
        5.0.0
      See Also:
        LongStream#count()