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 TypeMethodDescriptionvoidclose()The message should be closed when it is no longer needed.static ByteArrayMessagebase-64 decodes the message.Gets a binary representation of this message.base-64 encodes the message.booleanTwo messages of the same type with the same body must be considered equal.Gets the message type.inthashCode()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:MessageTwo messages of the same type with the same body must be considered equal. -
hashCode
public int hashCode()Description copied from interface:MessageThe hash code must be consistent with equals. -
getMessageType
Description copied from interface:MessageGets the message type.- Specified by:
getMessageTypein interfaceMessage
-
encodeAsString
base-64 encodes the message.- Specified by:
encodeAsStringin interfaceMessage
-
encodeAsByteArray
Description copied from interface:MessageGets a binary representation of this message.- Specified by:
encodeAsByteArrayin interfaceMessage
-
close
public void close()Description copied from interface:MessageThe message should be closed when it is no longer needed. -
getMessage
-
