Package net.dona.doip
Interface OutDoipMessage
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
OutDoipMessageImpl
public interface OutDoipMessage extends java.lang.AutoCloseableA DOIP message to be written as output (for example, a request from the client, or a response from the server). Users must callclose()when processing is complete.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()java.io.OutputStreamgetBytesOutputStream()Returns anOutputStreamthat can be used to write to a bytes segment.java.io.WritergetJsonWriter()Returns aWriterthat can be used to write to a JSON segment.voidwriteBytes(byte[] bytes)Writes a bytes segment into the outgoing message.voidwriteBytes(java.io.InputStream in)Writes 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.voidwriteJson(java.lang.String json)Writes a JSON segment into the outgoing message.
-
-
-
Method Detail
-
writeJson
void writeJson(com.google.gson.JsonElement json) throws java.io.IOExceptionWrites a JSON segment into the outgoing message.- Parameters:
json- the json to be written- Throws:
java.io.IOException
-
writeJson
void writeJson(java.lang.String json) throws java.io.IOExceptionWrites a JSON segment into the outgoing message.- Parameters:
json- the json to be written- Throws:
java.io.IOException
-
writeJson
void writeJson(byte[] json) throws java.io.IOExceptionWrites a JSON segment into the outgoing message.- Parameters:
json- the json to be written- Throws:
java.io.IOException
-
getJsonWriter
java.io.Writer getJsonWriter() throws java.io.IOExceptionReturns aWriterthat can be used to write to a JSON segment.- Returns:
- a
Writerthat can be used to write to a JSON segment - Throws:
java.io.IOException
-
writeBytes
void writeBytes(byte[] bytes) throws java.io.IOExceptionWrites a bytes segment into the outgoing message.- Parameters:
bytes- the bytes the be written- Throws:
java.io.IOException
-
writeBytes
void writeBytes(java.io.InputStream in) throws java.io.IOExceptionWrites 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:
java.io.IOException
-
getBytesOutputStream
java.io.OutputStream getBytesOutputStream() throws java.io.IOExceptionReturns anOutputStreamthat can be used to write to a bytes segment.- Returns:
- an
OutputStreamthat can be used to write to a bytes segment - Throws:
java.io.IOException
-
close
void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.io.IOException
-
-