微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在Java 8中,是否有一个ByteStream类?

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.

原文地址:https://www.jb51.cc/java/124693.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐