mirror of
https://github.com/fankes/moshi.git
synced 2025-10-19 16:09:21 +08:00
Merge pull request #61 from dave-r12/jsonreader-writer-javadoc-update
Update JsonReader & JsonWriter javadoc to use BufferedSource & BufferedSink
This commit is contained in:
@@ -83,7 +83,7 @@ import okio.ByteString;
|
|||||||
* ]}</pre>
|
* ]}</pre>
|
||||||
* This code implements the parser for the above structure: <pre> {@code
|
* This code implements the parser for the above structure: <pre> {@code
|
||||||
*
|
*
|
||||||
* public List<Message> readJsonStream(Source source) throws IOException {
|
* public List<Message> readJsonStream(BufferedSource source) throws IOException {
|
||||||
* JsonReader reader = new JsonReader(source);
|
* JsonReader reader = new JsonReader(source);
|
||||||
* try {
|
* try {
|
||||||
* return readMessagesArray(reader);
|
* return readMessagesArray(reader);
|
||||||
|
@@ -75,7 +75,7 @@ import static com.squareup.moshi.JsonScope.NONEMPTY_OBJECT;
|
|||||||
* }
|
* }
|
||||||
* ]}</pre>
|
* ]}</pre>
|
||||||
* This code encodes the above structure: <pre> {@code
|
* This code encodes the above structure: <pre> {@code
|
||||||
* public void writeJsonStream(Sink sink, List<Message> messages) throws IOException {
|
* public void writeJsonStream(BufferedSink sink, List<Message> messages) throws IOException {
|
||||||
* JsonWriter writer = new JsonWriter(sink);
|
* JsonWriter writer = new JsonWriter(sink);
|
||||||
* writer.setIndentSpaces(4);
|
* writer.setIndentSpaces(4);
|
||||||
* writeMessagesArray(writer, messages);
|
* writeMessagesArray(writer, messages);
|
||||||
|
Reference in New Issue
Block a user