1

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?

Shiva
  • 20,575
  • 14
  • 82
  • 112
Diego Macario
  • 1,240
  • 2
  • 21
  • 33
  • 1
    _But I didn´t found any thing about this._ Read _all_ of [this](http://docs.oracle.com/javase/tutorial/essential/io/) and _all_ of [this](http://docs.oracle.com/javase/tutorial/collections/implementations/list.html). – Sotirios Delimanolis Feb 08 '14 at 22:27

1 Answers1

2

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.

Community
  • 1
  • 1
assylias
  • 321,522
  • 82
  • 660
  • 783