Skip to content

Commit 449ed86

Browse files
committed
Update javadoc to clarify buffering of JsonParser.getText(Writer) wrt #1288
1 parent 27edeb7 commit 449ed86

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/com/fasterxml/jackson/core/JsonParser.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
import com.fasterxml.jackson.core.exc.InputCoercionException;
1515
import com.fasterxml.jackson.core.json.JsonReadFeature;
1616
import com.fasterxml.jackson.core.type.TypeReference;
17-
import com.fasterxml.jackson.core.util.JacksonFeatureSet;
18-
import com.fasterxml.jackson.core.util.RequestPayload;
17+
import com.fasterxml.jackson.core.util.*;
1918

2019
/**
2120
* Base class that defines public API for reading JSON content.
@@ -1575,6 +1574,12 @@ public String currentName() throws IOException {
15751574
* but should typically be more efficient as longer content does need to
15761575
* be combined into a single <code>String</code> to return, and write
15771576
* can occur directly from intermediate buffers Jackson uses.
1577+
*<p>
1578+
* NOTE: textual content <b>will</b> still be buffered (usually
1579+
* using {@link TextBuffer}) and <b>will</b> be accessible with
1580+
* other {@code getText()} calls (that is, it will not be consumed).
1581+
* So this accessor only avoids construction of {@link java.lang.String}
1582+
* compared to plain {@link #getText()} method.
15781583
*
15791584
* @param writer Writer to write textual content to
15801585
*

0 commit comments

Comments
 (0)