Package com.styra.opa.openapi.utils
Class EventStreamReader
java.lang.Object
com.styra.opa.openapi.utils.EventStreamReader
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static EventStreamMessage
parseMessage
(String text) Returns the event message (lines separated by \n) without the terminating \n\n.
-
Constructor Details
-
EventStreamReader
-
-
Method Details
-
readRawMessage
Returns the event message (lines separated by \n) without the terminating \n\n. Returns null when end of stream reached (and may occur with a partially read event message that has not yet been terminated). Characters in comment lines are discarded as read (they are not buffered).- Returns:
- the event message
- Throws:
IOException
-
readMessage
- Throws:
IOException
-
parseMessage
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-