Package net.dona.doip
Interface OutDoipMessage
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
OutDoipMessageImpl
A DOIP message to be written as output (for example, a request from the client, or a response from the server).
Users must call
close()
when processing is complete.-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Returns anOutputStream
that can be used to write to a bytes segment.Returns aWriter
that can be used to write to a JSON segment.void
writeBytes
(byte[] bytes) Writes a bytes segment into the outgoing message.void
Writes a bytes segment into the outgoing message.void
writeJson
(byte[] json) Writes a JSON segment into the outgoing message.void
writeJson
(com.google.gson.JsonElement json) Writes a JSON segment into the outgoing message.void
Writes a JSON segment into the outgoing message.
-
Method Details
-
writeJson
Writes a JSON segment into the outgoing message.- Parameters:
json
- the json to be written- Throws:
IOException
-
writeJson
Writes a JSON segment into the outgoing message.- Parameters:
json
- the json to be written- Throws:
IOException
-
writeJson
Writes a JSON segment into the outgoing message.- Parameters:
json
- the json to be written- Throws:
IOException
-
getJsonWriter
Returns aWriter
that can be used to write to a JSON segment.- Returns:
- a
Writer
that can be used to write to a JSON - Throws:
IOException
- if a JSON writer cannot be gotten
-
writeBytes
Writes a bytes segment into the outgoing message.- Parameters:
bytes
- the bytes the be written- Throws:
IOException
-
writeBytes
Writes a bytes segment into the outgoing message.- Parameters:
in
- an input stream from which bytes will be read and written to the outgoing bytes segment- Throws:
IOException
-
getBytesOutputStream
Returns anOutputStream
that can be used to write to a bytes segment.- Returns:
- an
OutputStream
that can be used to write to a bytes segment - Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-