the whole document, inflated
the document as it arrives, for a format that parses incrementally rather than whole
the SHA-256 of the bytes as they arrived, when the loader was asked to compute one
the document's lines, for the line-delimited formats
the bytes exactly as they arrived, still compressed if they were
read from the start until complete(text) holds, or the document ends. What was read stays
in the document and is delivered again, first, by NodesetDocument.chunks, so a
format that reads a header this way has not spent the source.
This is how a format avoids reading a body it does not need: the XML header pre-pass stops after a few hundred bytes of a four megabyte file.
the whole document as text, inflated and decoded
a document handed to a format, in whichever shape that format finds convenient. Every accessor inflates first when the document was gzipped, and the results are computed once and shared, so a format that asks for both the lines and the bytes pays for one inflate.