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 TypeMethodDescriptionvoidclose()Returns anOutputStreamthat can be used to write to a bytes segment.Returns aWriterthat can be used to write to a JSON segment.voidwriteBytes(byte[] bytes) Writes a bytes segment into the outgoing message.voidWrites a bytes segment into the outgoing message.voidwriteJson(byte[] json) Writes a JSON segment into the outgoing message.voidwriteJson(com.google.gson.JsonElement json) Writes a JSON segment into the outgoing message.voidWrites 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 aWriterthat can be used to write to a JSON segment.- Returns:
- a
Writerthat 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 anOutputStreamthat can be used to write to a bytes segment.- Returns:
- an
OutputStreamthat can be used to write to a bytes segment - Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-