java.lang.Object
com.aoapps.messaging.ByteArrayMessage
- All Implemented Interfaces:
Message
,Closeable
,AutoCloseable
A message that is a byte[].
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionByteArrayMessage
(byte[] message) Creates a newByteArrayMessage
.ByteArrayMessage
(ByteArray message) Creates a newByteArrayMessage
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
The message should be closed when it is no longer needed.static ByteArrayMessage
base-64 decodes the message.Gets a binary representation of this message.base-64 encodes the message.boolean
Two messages of the same type with the same body must be considered equal.Gets the message type.int
hashCode()
The hash code must be consistent with equals.toString()
-
Field Details
-
EMPTY_BYTE_ARRAY_MESSAGE
-
-
Constructor Details
-
ByteArrayMessage
public ByteArrayMessage(byte[] message) Creates a newByteArrayMessage
. -
ByteArrayMessage
Creates a newByteArrayMessage
.
-
-
Method Details
-
decode
base-64 decodes the message. -
toString
-
equals
Description copied from interface:Message
Two messages of the same type with the same body must be considered equal. -
hashCode
public int hashCode()Description copied from interface:Message
The hash code must be consistent with equals. -
getMessageType
Description copied from interface:Message
Gets the message type.- Specified by:
getMessageType
in interfaceMessage
-
encodeAsString
base-64 encodes the message.- Specified by:
encodeAsString
in interfaceMessage
-
encodeAsByteArray
Description copied from interface:Message
Gets a binary representation of this message.- Specified by:
encodeAsByteArray
in interfaceMessage
-
close
public void close()Description copied from interface:Message
The message should be closed when it is no longer needed. -
getMessage
-