* An FCP message. FCP messages consist of a name, an arbitrary amount of
* “fields” (i.e. key-value pairs), a message end marker, and optional payload
* data that follows the marker.
* An FCP message. FCP messages consist of a name, an arbitrary amount of
* “fields” (i.e. key-value pairs), a message end marker, and optional payload
* data that follows the marker.
* Creates a new FCP message with the given name and the given payload input
* stream. The payload input stream is not read until the message is sent to
* the node using {@link FcpConnection#sendMessage(FcpMessage)}.
* Creates a new FCP message with the given name and the given payload input
* stream. The payload input stream is not read until the message is sent to
* the node using {@link FcpConnection#sendMessage(FcpMessage)}.
- * @return <code>true</code> if the message has a field with the given
- * name, <code>false</code> otherwise
+ * @return <code>true</code> if the message has a field with the given name,
+ * <code>false</code> otherwise
/**
* Sets the field with the given name to the given value. If the field
* already exists in this message it is overwritten.
/**
* Sets the field with the given name to the given value. If the field
* already exists in this message it is overwritten.
* @return All fields of this message
*/
public Map<String, String> getFields() {
* @return All fields of this message
*/
public Map<String, String> getFields() {
- * payload (i.e. {@link #payloadInputStream} is not <code>null</code>)
- * the payload is written to the given output stream after the message as
- * well. That means that this method can only be called once because on the
- * second invocation the payload input stream could not be read (again).
- *
+ * payload (i.e. {@link #payloadInputStream} is not <code>null</code>) the
+ * payload is written to the given output stream after the message as well.
+ * That means that this method can only be called once because on the second
+ * invocation the payload input stream could not be read (again).
+ *
*/
public void write(OutputStream outputStream) throws IOException {
writeLine(outputStream, name);
*/
public void write(OutputStream outputStream) throws IOException {
writeLine(outputStream, name);
writeLine(outputStream, fieldEntry.getKey() + "=" + fieldEntry.getValue());
}
writeLine(outputStream, "EndMessage");
writeLine(outputStream, fieldEntry.getKey() + "=" + fieldEntry.getValue());
}
writeLine(outputStream, "EndMessage");
/**
* Writes the given line (followed by {@link #LINEFEED} to the given output
* stream, using UTF-8 as encoding.
/**
* Writes the given line (followed by {@link #LINEFEED} to the given output
* stream, using UTF-8 as encoding.