It compares against maxDocumentSizeStack.peek(), but then reports binaryWriterSettings.getMaxDocumentSize()