private void handleMimePart(BufferedReader reader) throws IOException {
        // Since we just shifted to a new section we want to read in the headers to determine which section it is.
        String headerLine;
        boolean stopParsingHeaders = false;
        while ((headerLine = reader.readLine()) != null && !stopParsingHeaders) {
            // If we've reached whitespace, then we are done with the headers.
            if (Strings.isEmpty(headerLine)) {
                // If we have reached a new MIME part but have no headers then we are likely at the end of the file.
                stopParsingHeaders = true;
                break;
            }

            Field field = Field.parseField(headerLine);
            if (field == null) {
                break;
            }
            Header header = Header.findHeader(field.getName());
            if (header == null) {
                break;
            }

            // If we have the Content Type header, use it to figure out what's the MIME area contains.
            if (header == Header.CONTENT_TYPE) {
                if (field.getValue().equals(CONTENT_TYPE_PLAIN)) {
                    readerLocation = ReaderLocation.PLAINTEXT_BODY;
                } else if (field.getValue().equals(CONTENT_TYPE_HTML)) {
                    readerLocation = ReaderLocation.HTML_BODY;
                }
            }
        }
    }