Close input stream after byte array retrieved