code: private void checkForFinalBoundary(String boundaryLine) throws IOException {
      if (boundaryLine.equals(boundary + "--")) {
        hasNext = false;
        inputStream.close();
      }
    }
docs: If the boundary line consists of the boundary and "--" then there are no more individual
  responses left to be parsed and the input stream is closed.