If the input is always equal byte[], then you are right, often there is no need for a stream. And if you do not need it, do not use it . Another advantage of ByteArrayInputStream is that it serves as a very strong sign that you plan to use read-only bytes (since the stream does not provide an interface for changing them), although it is important to note that the programmer can often still directly access bytes therefore you should not use this in a situation where a security issue is a problem.
byte[], , .., - " ", , . , InputStream. , ByteArrayInputStream - InputStream .
, , :
- , - ( , , ).
byte[] . , , InputStream - , byte[], ByteArrayInputStream. - , . unit test ; . , InputStream, ByteArrayInputStream.