public class ByteArrayPayload extends Object implements IDataPayload
PAYLOAD_TYPE_HEADER, PAYLOAD_TYPE_JPG, PAYLOAD_TYPE_MULTI, PAYLOAD_TYPE_SMS, PAYLOAD_TYPE_TEXT, PAYLOAD_TYPE_XML| Constructor and Description |
|---|
ByteArrayPayload()
Note: Only useful for serialization.
|
ByteArrayPayload(byte[] payload) |
ByteArrayPayload(byte[] payload,
String id,
int type) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
accept(IDataPayloadVisitor<T> visitor)
Visitor pattern accept method.
|
long |
getLength() |
byte[] |
getPayloadBytes() |
String |
getPayloadId() |
InputStream |
getPayloadStream()
Gets the stream for this payload.
|
int |
getPayloadType() |
int |
getTransportId() |
void |
readExternal(DataInputStream in,
PrototypeFactory pf) |
String |
toString() |
void |
writeExternal(DataOutputStream out) |
public ByteArrayPayload()
public ByteArrayPayload(byte[] payload,
String id,
int type)
payload - The byte array for this payload.id - An optional id identifying the payloadtype - The type of data for this byte arraypublic ByteArrayPayload(byte[] payload)
payload - The byte array for this payload.public InputStream getPayloadStream()
IDataPayloadgetPayloadStream in interface IDataPayloadpublic void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException
readExternal in interface ExternalizableIOExceptionDeserializationExceptionpublic void writeExternal(DataOutputStream out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic <T> T accept(IDataPayloadVisitor<T> visitor)
IDataPayloadaccept in interface IDataPayloadvisitor - The visitor to visit this payload.public byte[] getPayloadBytes()
public String getPayloadId()
getPayloadId in interface IDataPayloadpublic int getPayloadType()
getPayloadType in interface IDataPayloadpublic long getLength()
getLength in interface IDataPayloadpublic int getTransportId()
getTransportId in interface IDataPayloadCopyright © 2023. All rights reserved.