I have ip address string like "192.168.1.1". Is it possible to parse string using java 8 streams and get primitive byte array as a result. Currently i have code
Arrays.stream(address.split("\\."))
.map(UnsignedBytes::parseUnsignedByte)
.toArray(Byte[]::new);
where is UnsignedBytes is guava class which return byte, but this code return Byte[] not byte[]
Update: Yes, i read about why ByteStream class is absent. My question is about, is it possible to get byte array using java-8 streams, without overhead such as create intermediate list.