Package com.google.genai.gaos.utils
Class BlockingParser<T>
java.lang.Object
com.google.genai.gaos.utils.BlockingParser<T>
Blocking parser that reads from a Reader and delegates to a StreamingParser.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the underlying readerstatic BlockingParser<String>forJsonLines(Reader reader) Create a blocking parser for JSON Lines formatstatic BlockingParser<EventStreamMessage>Create a blocking parser for SSE formatbooleanhasNext()Check if there are more results available (either buffered or from reader)next()Read the next parsed result from the Reader.
-
Constructor Details
-
BlockingParser
-
-
Method Details
-
next
Read the next parsed result from the Reader.- Returns:
- next complete parsed result, or empty if no more data
- Throws:
IOException- if reading fails
-
hasNext
Check if there are more results available (either buffered or from reader)- Throws:
IOException
-
close
Close the underlying reader- Throws:
IOException
-
forJsonLines
Create a blocking parser for JSON Lines format -
forSSE
Create a blocking parser for SSE format
-