question: public static IByteSequence readAllBytesFromStream ( InputStream inputStream , int capacity ) throws IOException { try { final int BUFFER_SIZE = 1024 ; byte [ ] buffer = new byte [ BUFFER_SIZE ] ; ByteArrayOutputStreamExt bytes = new ByteArrayOutputStreamExt ( capacity ) ; int read ; while ( ( read = inputStream . read ( buffer ) ) != EOF ) { bytes . write ( buffer , 0 , read ) ; } return bytes ; } finally { inputStream . close ( ) ; } }
target:  Reads and returns all bytes from given inputStream until an EOF is read.  Closes inputStream afterwards.  ByteArray buffer is initialized to given capacity. 