public abstract class AbstractStreamEvent extends StreamEvent
Constructor and Description |
---|
AbstractStreamEvent() |
Modifier and Type | Method and Description |
---|---|
byte[] |
marshall()
Convert a StreamTuple object into a byte[] for communication.
|
void |
marshallAsBatch(DataOutputStream dataOutputStream) |
protected abstract void |
readValues(DataInputStream dataInputStream)
Read values specific to the data type from the input stream.
|
void |
unmarshall(byte[] bytes)
Populate a StreamTuple object from a byte array.
|
void |
unmarshallAsBatch(DataInputStream dataInputStream) |
protected abstract void |
writeValues(DataOutputStream dataOutputStream)
Write data type specific values to the output stream.
|
getPartitionKey, getStreamId, setStreamId
public void unmarshall(byte[] bytes) throws IOException
StreamEvent
unmarshall
in class StreamEvent
bytes
- byte array offered by the communication layer.IOException
public byte[] marshall() throws IOException
StreamEvent
marshall
in class StreamEvent
IOException
protected abstract void readValues(DataInputStream dataInputStream) throws IOException
dataInputStream
- DataInputStream containing the byte array.IOException
- Error when reading from input stream.protected abstract void writeValues(DataOutputStream dataOutputStream) throws IOException
dataOutputStream
- Output stream containing used to write the serialized
representation of an object.IOException
- Error when writing to output stream.public void marshallAsBatch(DataOutputStream dataOutputStream) throws IOException
marshallAsBatch
in class StreamEvent
IOException
public void unmarshallAsBatch(DataInputStream dataInputStream) throws IOException
unmarshallAsBatch
in class StreamEvent
IOException
Copyright © 2015. All rights reserved.