I have a byte[]
and I want to make a byte stream.
For int[]
and long
and double
, I see methods in the Arrays class:
Arrays.stream(int[] array)
Arrays.stream(long[] array)
Arrays.stream(double[] array)
However, I don't see any for a method Arrays.stream(byte[] array)
.
What then is the easiest and most concise way to then get a stream of byte primitives as actual bytes?
I need to do transformations on byte[]'s and I need a Stream of bytes to do it using all the Stream functions (and no, I don't want to convert them all to ints.)
Who has a nice solution?
PS. Someone else is providing me the byte[] from a microcontroller API ... So I don't want to play with some other data type if not necessary.
Thanks.