public class BufferingJSONAsyncParser extends Object implements JSONContext.AsyncParser
A JSONContext.AsyncParser that parses an array of Bayeux messages.
This is not a generic parser that can parse any JSON.
This parser buffers all input bytes in memory, and performs blocking JSON parsing
via JSONContext.parse(String) only when complete() is called.
| Constructor and Description |
|---|
BufferingJSONAsyncParser(JSONContext<? extends org.cometd.bayeux.Message.Mutable> jsonContext) |
| Modifier and Type | Method and Description |
|---|---|
<R> R |
complete()
Signals the end of the JSON string content to this parser and returns the parsed object.
|
void |
parse(byte[] bytes,
int offset,
int length) |
void |
parse(ByteBuffer byteBuffer) |
public BufferingJSONAsyncParser(JSONContext<? extends org.cometd.bayeux.Message.Mutable> jsonContext)
public void parse(byte[] bytes,
int offset,
int length)
parse in interface JSONContext.AsyncParserbytes - the bytes chunk to parseoffset - the offset to start parsing fromlength - the number of bytes to parsepublic void parse(ByteBuffer byteBuffer)
parse in interface JSONContext.AsyncParserbyteBuffer - the buffer chunk to parsepublic <R> R complete()
JSONContext.AsyncParserSignals the end of the JSON string content to this parser and returns the parsed object.
complete in interface JSONContext.AsyncParserR - the type to cast the result toCopyright © 2008–2022 The CometD Project. All rights reserved.