Package net.dona.doip
Interface InDoipSegment
- All Known Implementing Classes:
InDoipSegmentFromInputStream
,InDoipSegmentFromJson
public interface InDoipSegment
A segment of a DOIP message to be read as input (see
InDoipMessage
).-
Method Details
-
isJson
boolean isJson()Returns true if this is a JSON segment, false if this is a bytes segment.- Returns:
- true if this is a JSON segment, otherwise false
-
getInputStream
InputStream getInputStream()Returns an input stream, for either a JSON segment or a bytes segment.- Returns:
- an input stream containing the bytes from the segment (including a serialization of a JSON segment)
-
getJson
Returns the JSON of a JSON segment- Returns:
- the JSON of a JSON segment
- Throws:
IOException
- if there is a JSON parsing errorIllegalStateException
- if this is not a JSON segment
-