유한 Stream source API는 소유 자원과 크기 특성이 다르다
source 생성법만 외우면 close가 필요한 파일 stream과 재사용 가능한 collection을 같은 수명으로 다룰 수 있습니다.
| source | 유한성 | 주의 |
|---|---|---|
| collection.stream | 유한 | collection encounter order |
| Stream.of | 유한 | 고정 원소 |
| Arrays.stream | 유한 | 범위 지정 가능 |
| Files.lines | 유한 | close 필요 |
| builder.build | 유한 | build 후 builder 상태 |
핵심: 유한성·순서·close 책임을 함께 봅니다.