code: public static byte[] readBytesFromStream(InputStream source, int bufferSize) throws IOException {
          ByteArrayOutputStream buffer = new ByteArrayOutputStream();
          copyContentIntoOutputStream(source, buffer, bufferSize, true);
          return buffer.toByteArray();
      }
docs: read all bytes from an InputStream with the specified buffer size; doesn't close input-stream
  @param source     the input stream to consume
  @param bufferSize the buffer size to use when reading the stream
  @return the bytes read from 'is'
  @throws IOException if anything goes wrong reading from 'is'