gpt4 book ai didi

java - 在 Java 8 中,是否有 ByteStream 类?

转载 作者:IT老高 更新时间:2023-10-28 20:53:13 24 4
gpt4 key购买 nike

Java 8 提供 Stream<T> double 的专业, intlong : DoubleStream , IntStreamLongStream分别。但是,我找不到 byte 的等价物。在 the documentation .

Java 8 是否提供 ByteStream类(class)?

最佳答案

不,它不存在。实际上,它并没有被明确地实现,以免每个原始类型都有大量的类使 Stream API 困惑。

引用 a mail来自 OpenJDK 邮件列表中的 Brian Goetz:

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.

关于java - 在 Java 8 中,是否有 ByteStream 类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32459683/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com