Java 8提供Stream< T> double,int和long的专长:DoubleStream,IntStream和LongStream.但是,我在
the documentation中找不到等效的字节.
Java 8提供了一个ByteStream类?
解决方法
不,它不存在.实际上,它没有被明确地被实现,所以不能为每个原始类型的吨级集群Stream API.
从Brian Goetz在OpenJDK邮件列表中引用a mail:
Short answer: no.
It is not worth another 100K+ of JDK footprint each for these forms
which are used almost never. And if we added those,someone would
demand short,float,or boolean.Put another way,if people insisted we had all the primitive specializations,we would have no primitive specializations. Which would be worse than the status quo.