code: private static byte[] consume(final InputStream input) throws IOException {
          final ByteArrayOutputStream baos = new ByteArrayOutputStream();
          //@checkstyle MagicNumberCheck (1 line)
          final byte[] buf = new byte[4096];
          try {
              while (true) {
                  final int bytes = input.read(buf);
                  if (bytes < 0) {
                      break;
                  }
                  baos.write(buf, 0, bytes);
              }
          } finally {
              input.close();
          }
          return baos.toByteArray();
      }
docs: Consume input stream.
  @param input Input stream
  @return Bytes found
  @throws IOException If fails