Reputation: 1230
I want to get a inputStream
source from a file, and put this as a Byte
in a ArrayList
.
But I didn´t find any thing about this.
Can someone help me?
Upvotes: 1
Views: 475
Reputation: 328873
How about using Files#readAllBytes
:
byte[] bytes = Files.readAllBytes(path);
The conversion to a List<Byte>
, if you really need it, can be done with a simple loop.
Upvotes: 2