question: public static byte [ ] readAll ( InputStream inputStream ) throws IOException { ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ; byte [ ] buffer = new byte [ 1024 ] ; int k = 0 ; for ( ; ( k = inputStream . read ( buffer ) ) != - 1 ; ) { outputStream . write ( buffer , 0 , k ) ; } return outputStream . toByteArray ( ) ; }
target:  Reads all contents of the input stream.