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 Summary

    Modifier and Type
    Method
    Description
    Returns an input stream, for either a JSON segment or a bytes segment.
    com.google.gson.JsonElement
    Returns the JSON of a JSON segment
    boolean
    Returns true if this is a JSON segment, false if this is a bytes segment.
  • 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

      com.google.gson.JsonElement getJson() throws IOException
      Returns the JSON of a JSON segment
      Returns:
      the JSON of a JSON segment
      Throws:
      IOException - if there is a JSON parsing error
      IllegalStateException - if this is not a JSON segment