public FeedReader createReader(
            InputStream inputStream,
            DocumentTypeManager docTypeManager,
            FeedParams.DataFormat dataFormat)  {
        switch (dataFormat) {
            case XML_UTF8:
                byte [] peek = null;
                int bytesPeeked = 0;
                try {
                    if (debug && inputStream.markSupported()) {
                        peek = new byte[MARK_READLIMIT];
                        inputStream.mark(MARK_READLIMIT);
                        bytesPeeked = inputStream.read(peek);
                        inputStream.reset();
                    }
                    return new VespaXMLFeedReader(inputStream, docTypeManager);
                } catch (Exception e) {
                    if (bytesPeeked > 0) {
                        throw new RuntimeException("Could not create VespaXMLFeedReader. First characters are: '" + Utf8.toString(peek, 0, bytesPeeked) + "'", e);
                    } else {
                        throw new RuntimeException("Could not create VespaXMLFeedReader.", e);
                    }
                }
            case JSON_UTF8:
                return new JsonFeedReader(inputStream, docTypeManager);
            default:
                throw new IllegalStateException("Can not create feed reader for format: " + dataFormat);
        }
    }
Creates FeedReader
@param inputStream source of feed data
@param docTypeManager handles the parsing of the document
@param dataFormat specifies the format
@return a feedreader
vespaclient-container-plugin/src/main/java/com/yahoo/vespa/http/server/FeedReaderFactory.java