public abstract class Data extends Object
| Constructor and Description |
|---|
Data() |
| Modifier and Type | Method and Description |
|---|---|
boolean | equals(Object other) |
abstract Record.TYPE | getType()The payload type. |
int | hashCode() |
int | length() |
protected abstract void | serialize(DataOutputStream dos)The internal method used to serialize Data subclasses. |
byte[] | toByteArray() |
void | toOutputStream(DataOutputStream dos)Write the binary representation of this payload to the given DataOutputStream. |
void | toOutputStream(OutputStream outputStream)Write the binary representation to the given OutputStream. |
public abstract Record.TYPE getType()
public final int length()
protected abstract void serialize(DataOutputStream dos) throws IOException
dos - the output stream to serialize to.IOException - if an I/O error occurs.public final byte[] toByteArray()
public final void toOutputStream(DataOutputStream dos) throws IOException
DataOutputStream.dos - the DataOutputStream to write to.IOException - if an I/O error occurs.public final void toOutputStream(OutputStream outputStream) throws IOException
outputStream - the OutputStream to write to.IOException - if an I/O error occurs.