private Document readDocumentFromJson(String docId, String fields) throws IOException {
        InputStream rawDoc = new ByteArrayInputStream(asFeed(docId, fields));

        JsonReader r = new JsonReader(types, rawDoc, parserFactory);
        DocumentParseInfo raw = r.parseDocument().get();
        DocumentType docType = r.readDocumentType(raw.documentId);
        DocumentPut put = new DocumentPut(new Document(docType, raw.documentId));
        new VespaJsonDocumentReader(false).readPut(raw.fieldsBuffer, put);
        return put.getDocument();
    }
Functional tests for com.yahoo.document.json.JsonWriter.

@author Steinar Knutsen
document/src/test/java/com/yahoo/document/json/JsonWriterTestCase.java